This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Servlets and the fly likes JDBC Error with Servlets not with Application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "JDBC Error with Servlets not with Application" Watch "JDBC Error with Servlets not with Application" New topic
Author

JDBC Error with Servlets not with Application

Scott Layne
Greenhorn

Joined: Jun 19, 2002
Posts: 3
I am having a problem that I simply cannot figure out.
I have a MS Access database defined through ODBC, and when I connect through an appliation, no problem. but when my servlet tries to connect to the same db, it can not do it, and it throws an exception.
Here is the offending code:

I turned on JDBC logging, and this is the output.
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695


Perhaps the MSAccess error code could provide some insight. If it prints out a nice 'sql error' number, you can search for that on MSDN.
Scott Layne
Greenhorn

Joined: Jun 19, 2002
Posts: 3
I put in the system.out statement and got:
sqlerror = 0
Ivan Tamayo
Ranch Hand

Joined: Aug 13, 2001
Posts: 49
Inside try{...}catch block, put the following statement:
Class.forName(xxxxxx)
xxxx: driver jdbc-odbc driver
without the ".newInstance" part.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC Error with Servlets not with Application