Java Program - Not able to connect to 32 bit ODBC
My machine is Windows 7 64 bit. I have eclipse installed on machine and have a java program which is working fine. Java program reads xml file and inserts data into Oracle database. The program uses 64 bit jre (checked via Run--> Run Configutation --> jre). Java connectivity to db is via ODBC and i created DSN name in ODBC (C:\Windows\System32\odbcad32.exe -64 bit)
Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
c = DriverManager.getConnection( "jdbc:odbc:"+dsn, username, password );
But this program needs to be changed to use 32 bit ODBC as in our actual environment, all 32 bit ODBC connections is used.
I did some search on this problem and found solution that jre of 32 bit needs to be used which will point to 32 bit ODBC as it has access-bridge-32.jar file in it.
Now after doing this (also created DSN under C:\Windows\SysWow64\odbcad32.exe)and when running the program, the following error is coming while executing any sql statement in program
java.sql.SQLException: General error
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcStatement.execute(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcStatement.executeQuery(Unkno wn Source)
Can someone please suggest what needs to be done