Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't connect to driver sun.jdbc.odbc.JdbcOdbcDriver

Status
Not open for further replies.

ProgrammingB52

Technical User
May 7, 2003
37
0
0
US
Below is my code and I am getting a connection unsuccessful error. I am trying to use a sql server database. I didn't do anything in the control panel odbc datasources.

try
{
String url = "jdbc:eek:dbc:employeeExpense";

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
dbConn = DriverManager.getConnection(url);
msgOut.insert("Connection successful\n", 0);
msgOut.select(0, 0);
}

catch (ClassNotFoundException cnfex)
{
cnfex.printStackTrace();
msgOut.insert("Connection Unsuccessful\n" + cnfex.toString(), 0);
msgOut.select(0, 0);
}
 
Got it working. What it was was in the control panel for ODBC datasources the sql server driver had to be set to windows authentication mode.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top