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

JNDI problem

Rashid Darvesh
Ranch Hand

Joined: Feb 13, 2004
Posts: 189
i think i need to post the question more clearly.
Here is one more go.
i have created a connection pool by name jdbc/myoracle and i referenced thru my context
<Context path="/STRUTS" docBase="C:\Strutsexplore\web" debug="0" reloadable = "true" crossContext="true">
<ResourceLink name="jdbc/myoracle" global="jdbc/myoracle" type="javax.sql.DataSource"/>
Under the globalNamingresources tag i have the declaration
<Resource auth="Container" name="jdbc/myoracle" type="javax.sql.DataSource" driverClassName="oracle.jdbc.driver.OracleDriver" password="pictures_charger" maxIdle="10" maxWait="-1" username="pictures_charger" url="the url" maxActive="20"/>
This Works no problem.
Now let us consider if i dont want to write a context tag and specify the doc base. for example i just ran the ant script generated a war file and drop the war file in the webapps folder. Since i didn't create the context, tomcat will automatically unzip the war file, how can i reference the Data source since i cant declare the resource link. In summary, can i create a connection pool globally and is not tied to a particular context. Like in WEblogic, i just create a connection pool and tie it to a data source and all the application and look up for that data source. i hope its clear. is there a way to acheive this.
I agree. Here's the link:
subject: JNDI problem
It's not a secret anymore!