aspose file tools*
The moose likes Tomcat and the fly likes Driver is not loading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Driver is not loading" Watch "Driver is not loading" New topic
Author

Driver is not loading

Singh Anisha
Ranch Hand

Joined: May 09, 2012
Posts: 100

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

Joined: Jan 08, 2009
Posts: 1478
    
    6

For web application you need to have the driver (.jar) files inside WEB-INF\lib directory.


Swastik
Singh Anisha
Ranch Hand

Joined: May 09, 2012
Posts: 100

I did that too but of no use
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61653
    
  67

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?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Driver is not loading