0
votes

I am trying to create a database application with java as front end and oracle as the back end.

I have a 64-bit win7 system with 32-bit oracle 10g (10.2) installed.

I created a DSN from/via C:\Windows\SysWOW64\odbcad32.exe because "control panel/administrative tools/odbc data source" doesn't show options for "Microsoft Oracle ODBC"

But while connecting to the database I get this error:

java.sql.SQLException: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6956)
    at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7113)
    at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:3072)
    at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:323)
    at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:174)
    at java.sql.DriverManager.getConnection(DriverManager.java:579)
    at java.sql.DriverManager.getConnection(DriverManager.java:221)
    at InsertRecord.main(InsertRecord.java:28)
    at __SHELL7.run(__SHELL7.java:6)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at bluej.runtime.ExecServer$3.run(ExecServer.java:724)

I assume this is because 64-bit 32-bit clash. if so then if I install odbc driver for 64 bit will it work or I need to install oracle database for win64 all over again.

If the driver would do then from where can I download the driver alone?

any one any help?? i am getting this error while trying to connect to oracle using odbc

Driver loaded
java.sql.SQLException: [Microsoft][ODBC driver for Oracle][Oracle]ORA-06413: Connection not open.
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at InsertRecord.main(InsertRecord.java:28)
java.lang.NullPointerException
1
Any reason for not using the native Java drivers for Oracle (type 4) without the need for setting up an ODBC data source?home
no specific reasons its just i am new to it and i knew that way because i had used it already in 32-win7RC-user
May be you can keep both oracle database driver for 64 bit as well as 32 bit. Go through the link communities.sas.com/thread/34643?start=0&tstart=0Ankit
@Ankit but that means i need to download that and go over the process all over again !! won't the drivers do the job?RC-user
any link for odbc drivers 64-bit ?RC-user

1 Answers

2
votes

You shouldn't be using the JDBC/ODBC bridge in the first place.

Download Oracle's (pure Java) JDBC driver (http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html) and you don't have to worry about any 32bit vs. 64bit mismatch any more.

As an additional benefit the database access will be faster and more reliable.

And there is nothing to "install", just use the .jar file from within your application. No messing around with tnsnames.ora, no Oracle client to be installed on the computer.