Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Validate Tomcat 5.5x JNDI Configuration?

490060Mar 7 2006 — edited Mar 8 2006
Are there any documented instructions for setting up JNDI in Tomcat and/or how can I tell if database connection pooling is being used?

Here are the steps I am taking (per Tomcat 5.5 docs - http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html - see #JDBC Data sources) – do these look correct or am I missing any steps?

1. Add to web application in Jdev /WEB-INF/web.xml file:
<resource-ref>
<res-ref-name>jdbc/mysql</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

2. Add to web application in Jdev /META-INF/context.xml file
<?xml version="1.0" encoding="ISO-8859-1"?>
<Context path="/myapp" docBase="myapp" debug="5" reloadable="true"
crossContext="true">
<Resource name="jdbc/mysql" auth="Container" type="javax.sql.DataSource"
maxActive="10" maxIdle="30" maxWait="10000" username="root"
password="pwd" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/myapp"/>
</Context>

3. Set Project Properties ‘Offline Database’ = MySQL 5.x

And, I picked these steps up from a previous JDeveloper forum article related to setting up a Jdeveloper application to use Tomcat JNDI, so I’m not sure if this is correct:

4. From previous forum article – configuring application module:
a. “Configure your (main) application module by copying the <name>Local configuration into a eg. <name>Tomcat55. Change connection type in JDBC Datasource and use eg. java:comp/env/jdbc/OracleDS as JNDI name.”

How I accomplished this:
o added a new configuration to my application module (wasn’t sure what was meant by a ‘main’ application module?) named "IspmainAllRowsTomcat55"
o set JDBCDatasource: java:comp/env/jdbc/mysql;
o set jbo.sql92.JdbcDriverclass: com.mysql.jdbc.driver;
o set java.naming.factory.initial as default: oracle.jbo.common.JboInitialContextFactory (didn’t know if this was correct or not?)
o set DeployPlatform: LOCAL (did not know whether to set to ‘Tomcat’?)

b. “Configure your databindings file to use this new configuration. (<name>AppModuleDataControl)”

How I accomplished this:
(in application navigator) /application sources/package/databindings.cpx set:
Configuration="IspmainAllRowsTomcat55"
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 5 2006
Added on Mar 7 2006
1 comment
560 views