It's not a secret anymore!
The moose likes JDBC and Relational Databases and the fly likes MSSQL JDBC driver with tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "MSSQL JDBC driver with tomcat" Watch "MSSQL JDBC driver with tomcat" New topic

MSSQL JDBC driver with tomcat

Ken Shamrock
Ranch Hand

Joined: Jan 23, 2002
Posts: 139
I try to place all mssql *.jar into \tomcat\common\lib

I compile my java file with "import*;"
it says

" package does not exist

but if I extract the mssql jar files into tomcat\common\lib\com\microsoft\jdbc\sqlserver.
it can, how can I fix the problem? Thanks

Thanks everyone who helped me
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3753

You need to set your Tomcat classpath properly. The files aren't really compiled with the mysql.jar (unless you're using MySQL specific classes in your code which is often unlikely), so the file is rarely not used during compiling.

It is, on the other hand, used directly at runtime. You may need to place the jar into the WEB-INF/lib directory of the web application. It's been awhile since I've used tomcat, so I could be off on that. Other than that, try updating the classpath for tomcat to find the jar you placed.

[OCA 8 Book] [Blog]
I agree. Here's the link:
subject: MSSQL JDBC driver with tomcat
It's not a secret anymore!