2 Replies Latest reply: Aug 23, 2007 8:57 AM by 807605 RSS

    Database Connectivity Issue

    807605
      Hi all,

      I am facing a problem during database connectivity by ODBC connection.

      I used the below query for creating connection
      Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
      connection = DriverManager.getConnection("jdbc:odbc:DSNNAME", "username", "password");
      it is working fine with one SQL server.. but when am trying to another SQL Server i got the following error.

      java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.

      But on configuring DSN i'm able to connect to the server and it says "TEST COMPLETED SUCCESSFULLY".

      Also i'm able to connect to the SQL thru Query Analyzer. Only problem upon connecting thru the above Java coding. PLease help me to resolve this. Thanks in Advance