This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC Error with Servlets not with Application

 
Scott Layne
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3695
IntelliJ IDE Java Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I put in the system.out statement and got:
sqlerror = 0
 
Ivan Tamayo
Ranch Hand
Posts: 49
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Inside try{...}catch block, put the following statement:
Class.forName(xxxxxx)
xxxx: driver jdbc-odbc driver
without the ".newInstance" part.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic