Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Ashan Kaya   on Jun 13 In Java Category.

  
Question Answered By: Debbie Reyes   on Jun 13

first step you should cetain that your sql  server driver  is ok on your machine
and then you should create odbc  with your sql server  driver and test to connect  it correctly and then you could implement your jdbc :


private static final String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
private static final String dsn = "jdbc:odbc:yourODBCname";
private Connection conn;

public static void main(String[] args) {

try {
Class.forName(driver);
conn = DriverManager.getConnection(dsn, "username", "password");
} catch(Exception e) {
e.printStackTrace();
}
}

it's better that you use another username and password that you make it in sql server yourself instead of 'sa'.

Share: 

 

This Question has 5 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Problem to connect to sql server (with BMP and JBOSS) Or get search suggestion and latest updates.


Tagged: