You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by gi...@netscape.net on 2002/02/09 00:18:24 UTC

jdbc driver deployment problem.

Q: How can I get Tomcat to see 3 specific jar files?  They're already in my classpath.

Details:
Win2k, MSSQL 2k sp1, tomcat 4.0.1 (not a service), apache 1.3.22 (service).

Aargh.  It was suggested that I try to change jdbc drivers in my servlets.  I used to use the jdbc/odbc bridge (sun provided) driver and decided to replace it with Microsoft's MSSQL 2000 Server JDBC type 4 driver (beta 2) to see if it solved my (other) problem.  If it works, I'll be open to buying a better (released) driver.  For now, I can't get it to work.  Microsoft's news server has a newsgroup just for this driver and I've read all about it.  I can get a test app to work with it.  After plugging the driver into my servlet on the same machine, it doesn't work.  (Same thing on my workstation and our production server)

I get a java.lang.ClassNotFoundException.  This is what happened in my test app until I got 3 jar files into my classpath.  Now that I try it inside Tomcat, the jar files are not in scope.  It occurs after one of these two lines:

Class.forName("com.microsoft.sqlserver.SQLServerDriver");
con = DriverManager.getConnection
("jdbc:microsoft:sqlserver://172.29.6.12:1433;DatabaseName=sqaa;user=sqaauser"
);

In trying to remedy the problem, I put the drivers in the same directory as my servlets

I get it working outside Tomcat, so I conclude that it's a Tomcat issue.  If you think this is an issue with the driver and not Tomcat, I'll ask the jdbc driver newsgroup.

Regards,
-Phil

-- 




__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: jdbc driver deployment problem.

Posted by Paul DuBois <pa...@snake.net>.
>Q: How can I get Tomcat to see 3 specific jar files?  They're 
>already in my classpath.
>
>Details:
>Win2k, MSSQL 2k sp1, tomcat 4.0.1 (not a service), apache 1.3.22 (service).

Tomcat 4.x doesn't use your CLASSPATH.

>
>Aargh.  It was suggested that I try to change jdbc drivers in my 
>servlets.  I used to use the jdbc/odbc bridge (sun provided) driver 
>and decided to replace it with Microsoft's MSSQL 2000 Server JDBC 
>type 4 driver (beta 2) to see if it solved my (other) problem.  If 
>it works, I'll be open to buying a better (released) driver.  For 
>now, I can't get it to work.  Microsoft's news server has a 
>newsgroup just for this driver and I've read all about it.  I can 
>get a test app to work with it.  After plugging the driver into my 
>servlet on the same machine, it doesn't work.  (Same thing on my 
>workstation and our production server)
>
>I get a java.lang.ClassNotFoundException.  This is what happened in 
>my test app until I got 3 jar files into my classpath.  Now that I 
>try it inside Tomcat, the jar files are not in scope.  It occurs 
>after one of these two lines:
>
>Class.forName("com.microsoft.sqlserver.SQLServerDriver");
>con = DriverManager.getConnection
>("jdbc:microsoft:sqlserver://172.29.6.12:1433;DatabaseName=sqaa;user=sqaauser"
>);
>
>In trying to remedy the problem, I put the drivers in the same 
>directory as my servlets
>
>I get it working outside Tomcat, so I conclude that it's a Tomcat 
>issue.  If you think this is an issue with the driver and not 
>Tomcat, I'll ask the jdbc driver newsgroup.


If you want it visible only to your application, put it in the application's
WEB-INF/lib directory

If you want it visible to all applications, put it in the lib directory under
the Tomcat root.

If you want it visible both to applications and to Tomcat, put it in the
common/lib directory under the Tomcat root.


>
>Regards,
>-Phil


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>