File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jdbc connection to mssql2000 db server

 
mohan kannan
Greenhorn
Posts: 26
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
I am using jdbc-odbc driver to connect to mssql2000 database.
The code used is below

I have tested this code local system with "sa" rights (default user name and password) and works successfully for creating table, adding,listiing recpords.
But when uploading the files on server (Tomcat4.0.1) with exact user name and password provided by server administrator, and when run the related jsp's involving db connection, I am getting the following error
Error Number. 2 : SQLException: Could not connect to DB
Please suggest what's the problem.
pl suggest Whether sun.jdbc.odbc.JdbcOdbcDriver can be used on the web server?
Server administrator says the dsn is configured properly and user name and password are correct.
Thanks in advance
K.Mohan
[ Edited by Dave to format code and remove the UBB smilies ]
[ February 04, 2002: Message edited by: David O'Meara ]
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doesn't seem like you're finding enough information. Have you tried printing cnfe.getMessage()?
I'd rethrow the same exception rather than throwing it with a new message, you're losing the original.

DOM
 
Dave Vick
Ranch Hand
Posts: 3244
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try printing the venor error code too, that might give you a clue if it a SQL Server problem.
sqle.getErrorCode();
Dave
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic