File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes DataSource in Tomcat 5.5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "DataSource in Tomcat 5.5" Watch "DataSource in Tomcat 5.5" New topic

DataSource in Tomcat 5.5

Johnny Belab

Joined: Oct 05, 2005
Posts: 12
Why defining Datasource to Tomcat is so hard...
I have tried couple of different ways to do it but it does not work.
Could someone please tell how to define e.g. Datasource in Tomcat 5.5.x that supports Oracle.

Doing it it in the way Tomcat's documentation says does not work.
I have also tried to define it to NetBeans 4.1 embedded Tomcat but it does not work either.

I would be very pleased to have information or sample configurations.

Jon Bates

Joined: Oct 06, 2005
Posts: 8

I am no expert, but since noone else has posted, Ill try my best

1) Goto the admin console in tomcat. For the localhost, you can try and log in

2) select "Data Sources" from the left hand pane, and wait for the page to load.

3) in "Data Source Actions" on the top right of the screen, select "Create New DataSource"

4) type in the JNDI source name you want to associate with the connection pool, add the class name (as if calling `class.forname(...)' when creating a normal connection) and anything else you like.

5) finally, save and commit changes.

This should give you a connection pool which can be used in the standard manner. You will need to add your DB connection jar to the tomcat_dir\common\lib directory (I think, but i may get a slap on the wrists!)


Jon Bates
I agree. Here's the link:
subject: DataSource in Tomcat 5.5
It's not a secret anymore!