Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JNDI problem

 
Rashid Darvesh
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"/>
</Context>
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.
Thanks
Rashid
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic