File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Driver is not loading

 
Singh Anisha
Ranch Hand
Posts: 100
Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I code a servlet to establish connection with mysql.
set classpath of mysqldriver(setting environment variable from windows)
by mannually setting the classpath from cmd...
i checked the classpath at cmd it was echoing.
but driver was not loading


When i tried the same thing in NetBeans its working fine.
Can anybody help me out regarding the same.
 
Swastik Dey
Rancher
Posts: 1601
5
Android Java Java ME
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For web application you need to have the driver (.jar) files inside WEB-INF\lib directory.
 
Singh Anisha
Ranch Hand
Posts: 100
Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did that too but of no use
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64185
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Singh Anisha wrote:set classpath of mysqldriver(setting environment variable from windows)
by mannually setting the classpath from cmd...
i checked the classpath at cmd it was echoing.

That is all useless. Web applications do not pay any attention whatsoever to the command line class path.

Are you using container-managed connection pooling? If not, you should be. But if not, then placing the jar file in WEB-INF/lib should work. If it's not, your web app is likely not configured correctly. Does it look correct in the Tomcat Manager application?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic