• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

architecture mismatch between the Driver and Application

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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("jdbc:odbc: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)
 
Ranch Hand
Posts: 119
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.)
 
reply
    Bookmark Topic Watch Topic
  • New Topic