You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ben Bookey <be...@gistec-online.de> on 2004/09/15 17:44:28 UTC

Workaround for using JNDI sources in the web.xml instead of the server.xml?

Dear list,

We use a datasource and realm for our app, which is currently inside of the
server.xml file
for tomcat. This is used in the application descriptor (web.xml) to control
access.

When my app. is packaged the server.xml is not inside the .war file. This
makes the installation
task, just that little bit more complex. It would be nicer if the jdbc realm
(referenced in the web.xml) could
be installed along with the .war file.  Can anyone make a suggestion?

'===========================================================================
=================================
 <Context path="/myApp" docBase="D:\MyProjects\myApp" reloadable="true">
          <Realm
            className="org.apache.catalina.realm.JDBCRealm"
            debug="99"
            driverName="oracle.jdbc.driver.OracleDriver"
            connectionURL="jdbc:oracle:thin:@111.111.111.11:1521:mySID"
                     connectionName="myAppUser"
                     connectionPassword="myAppUser"
                     userTable="users"
            	     userNameCol="user_name"
                     userCredCol="user_pass"
            userRoleTable="user_roles"
            roleNameCol="role_name"/>

          <Resource name="jdbc/myoracle" auth="Container"
type="javax.sql.DataSource"/>
	    <ResourceParams name="jdbc/myoracle">
            <parameter>
              <name>factory</name>
              <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
            </parameter>
            <parameter>
              <name>driverClassName</name>
              <value>oracle.jdbc.driver.OracleDriver</value>
            </parameter>
            <parameter>
              <name>url</name>
              <value>jdbc:oracle:thin:@111.111.111.11:1521:mySID</value>
            </parameter>
            <parameter>
              <name>username</name>
              <value>myAppUser</value>
            </parameter>
            <parameter>
               <name>password</name>
               <value>myAppUser</value>
            </parameter>
          </ResourceParams>
        </Context>

'===========================================================================
=================================
regards.

Ben Bookey


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org