wood burning stoves*
The moose likes JDBC and the fly likes JDBC problems using Servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC problems using Servlets" Watch "JDBC problems using Servlets" New topic
Author

JDBC problems using Servlets

rahul markonda
Greenhorn

Joined: Jul 13, 2011
Posts: 9
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

Joined: Mar 18, 2011
Posts: 312

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).


S.D. MADHAN
Not many get the right opportunity !
rahul markonda
Greenhorn

Joined: Jul 13, 2011
Posts: 9
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

Joined: Mar 18, 2011
Posts: 312

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

Joined: Jul 13, 2011
Posts: 9
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC problems using Servlets