• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 263
  • Last Modified:

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.
0
changcy77
Asked:
changcy77
  • 6
  • 3
1 Solution
 
kennethxuCommented:
find the classes12.zip file in any of oracle installation. copy it to <tomcat>/common/lib and RENAME it to oraclejdbc12.jar
0
 
changcy77Author Commented:
Thanks.
But, I have used it without renaming it on my machine. Why do you suggest to rename it?
0
 
kennethxuCommented:
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?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
kennethxuCommented:
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.
0
 
umangjoshiCommented:
put in web-inf/lib directory
0
 
kennethxuCommented:
>> 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.
0
 
changcy77Author Commented:
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.
0
 
kennethxuCommented:
>> 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.
0
 
kennethxuCommented:
>> 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.
0
 
changcy77Author Commented:
thanks very much.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 6
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now