This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
Hi, I am trying to use jTDS driver 0.9rc1 to connect to SQL 2000 and I am keep getting following error... java.sql.SQLException: Cannot open database requested in login 'testdb'. Login fails. at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:366) at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2048) at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:1648) at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:462) at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:274) at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:48) at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:112) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:171) at SQLTest.main(SQLTest.java:15)
Hi Jeanne, I tried even with port but I am still getting the error. Infact when create ODBC connection to the same database with same user and password it works fine. I tried jdbc dbc bridge, it works there! I dont know what I am missing here for this jTDS. Looks like it is identifying the database and not able to authenticate the login.
Joined: Aug 27, 2003
problem solved! It was issue with roles assigned to the user. I should select only public role to access table owned by 'dbo'. I changed the roles and now it works.
thanks for the effort. ravi
subject: jTDS Driver is giving error when connecting to SQL 2000