Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC problems using Servlets

 
rahul markonda
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I'm using Servlet and MS access as database I'm having some problems......(but using a direct JDBC program and MS access as database it works fine )
I get the following error msg in browser ......
The error msg is : the specified dsn contains an architecture mismatch between the driver and application
If I dont use DSN then: [Microsoft][ODBC Microsoft Access Driver] Disk or network error.
Please help.......I use window 7 64-bit
and MS Access 2010
 
Madhan Sundararajan Devaki
Ranch Hand
Posts: 312
Java MS IE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe you are using 64-bit JVM. Also, MS-Access is extended from standard RDBMS by MS and hence may not be able to support multiple simultaneous connections from a Servlet. You should always create a DSN to access any MicroSoft RDBMS (such as SQL Server).
 
rahul markonda
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for reply.
Yes the JVM is also 64 bit . But I'm not using any multiple connections at the same time. I was just trying to access it from servlet i.e., from browser. I also am using DSN created for Microsoft access......
When I set a dsn by the name 'mydsn' for MS Access......

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");------Line 7
Connection con = DriverManager.getConnection("jdbcdbc:mydsn","","");--------Line 8

Line 7 compiles and runs
but Line 8 is the one which causes the error:
[ODBC Microsoft Access Driver] The specified dsn contains an architecture mismatch between the driver and application
Do you think i should download any driver?
Thank you........
 
Madhan Sundararajan Devaki
Ranch Hand
Posts: 312
Java MS IE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Servlets are multi-threaded and in this case has requested multiple connections.

As you are using Windows7 64-bit, the ODBC driver is compliant.
 
rahul markonda
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.
Can you please send me the link to the driver?
Or please attach it to this message.
I did a lot of research in internet but still could not find the right ODBC driver.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic