File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes jdbc connection to mssql2000 db server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "jdbc connection to mssql2000 db server" Watch "jdbc connection to mssql2000 db server" New topic
Author

jdbc connection to mssql2000 db server

mohan kannan
Greenhorn

Joined: Dec 02, 2001
Posts: 26
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

Joined: Mar 06, 2001
Posts: 13459

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

Joined: May 10, 2001
Posts: 3244
Try printing the venor error code too, that might give you a clue if it a SQL Server problem.
sqle.getErrorCode();
Dave


Dave
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jdbc connection to mssql2000 db server
 
Similar Threads
JDBC That fails in one workspace but works in another
establishing connection to mssql2000
Connecting to MSSQL2000
connecting to Webtrends reporting DB using JDBC-ODBC
Could not locate DB driver