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 ]
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.