aspose file tools*
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
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
 
Similar Threads
JDBC Error with servlets - please help
java.lang.OutOfMemoryError
Oracle Connection from class used by Servlet
UnsatisfiedLinkError
Why am I getting this error!!!!