Link to home
Start Free TrialLog in
Avatar of changcy77
changcy77

asked on

where to put the Oracle JDBC driver under Tomcat?

Dear experts,

We have just installed a new server for Tomcat. I have Tomcat running on my PC fine, but we are not sure where to put the Oracle JDBC driver on our server since it is shared by multiple users. Another question is reload does not seem to work all the time even we have it set to true in server.xml, any idea?

Thank.
ASKER CERTIFIED SOLUTION
Avatar of kennethxu
kennethxu

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of changcy77
changcy77

ASKER

Thanks.
But, I have used it without renaming it on my machine. Why do you suggest to rename it?
tomcat will automatically put all .jar files under common/lib into it's classpath. it is by tomcat's design that only .jar files are searched, not .zip files. so just rename it to anything.jar will do the purpose.

have you tried it?
about the question of reload, it depends on what you have changed. not all changes can be reloaded. but you can always use tomcat manager to force a complete reload of specified context. so you don't have to restart the server.
put in web-inf/lib directory
>> put in web-inf/lib directory
anything in web-inf/lib is only accessible by one webapp. database driver should be availabe to all webapps deployed to the server as well as tomcat server itself. especially if you intend to use connection pool datasource provided by tomcat.
thanks.

the truth is after testing, i found web-inf/lib won't work even just for one webapp. i think common/lib will be the answer, but i have to get through other people to test that. the other thing is i am not convinced zip file won't work..it works on stand alone Tomcat.
>> the other thing is i am not convinced zip file won't work

maybe tomcat fixed this in its newest release. rename the zip is based on experience of mine and quite of others. We do considered this was tomcat's bug, because zip and jar are essentially the some format. I have explained the cause of this bug in my previous post.

To be in save part, I always advise to rename, since there is no harm at all to rename the zip to jar. and it just doesn't make sense that oracle name their jdbc driver package as classes12.zip, it is just for historical reason :)

as long as it is working for you, you don't need to rename it.
>> i found web-inf/lib won't work even just for one webapp
it depend on how you used it. if you use tomcat's connection pool. you are right that it won't work because tomcat server class loader doesn't have access to it. but if you use Class.forName() and DriverManager.getConneciton(), it should be able to work because your webapp's class loader can access it.

anyway, it is not a good practice to put any database driver under web-inf/lib.
thanks very much.