• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

architecture mismatch between the Driver and Application

 
Firoj Raj Rai
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been trying to connect mysql using Type I driver in Windows 7.
I have installed MySQL connector 5.2.
Selected my DSN properly
I've used the following code:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbcdbc:dbmysql","root","firoj");

The error it is showing is:
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 p11.Testjdbc.main(Testjdbc.java:11)
 
Wayan Saryada
Ranch Hand
Posts: 105
IntelliJ IDE MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wouldn't it be simpler to use the Type 4 instead? Any specific requirement that you avoid to use the pure Java JDBC driver for MySql?
 
Firoj Raj Rai
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the specific requirement to use odbc driver for my application.....
Please post only if you have a solution for the above...
my system has Windows7 64 bit OS.
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The ODBC bridge is known to contain bugs, it's usage for anything but testing or prototyping has been discouraged for many years and its support will be removed completely in Java 8. The requirement to use ODBC will cause you a lot of pain. The most sensible thing for you to do would be to try having the requirement changed.

If you have to use ODBC nevertheless, my advice would be to make sure that all components involved in your connection (the JVM, the ODBC itself, the MySQL driver used by the ODBC connection) are 32-bit. (It looks like that some of the components involved are 32-bit and some 64-bit. Going completely 64-bit is probably more problematic than going completely 32-bit.)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic