• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

jTDS Driver is giving error when connecting to SQL 2000

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)

for the code


Can someone help me how to fix this problem.

thanks & regards
ravi
 
author & internet detective
Posts: 40791
828
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ravi,
I'm not familiar with SQL Server, but most databases require a port in the connection string.
 
Ravi Tiruvaipati
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

ravi
 
Ravi Tiruvaipati
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic