db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From EP...@upstate.com
Subject Anyone have Sample JNDI datasource Config?
Date Mon, 10 Feb 2003 14:21:34 GMT
Hi all,

I am trying to get away from all these various properties driven datasource
config stuff, and use the JNDI stuff.  I am having difficulties trying to
get the JNDI datasources to config.   My torque.log looks like this:

2003-02-10 09:21:07,246 [main] INFO  org.apache.torque.Torque - Logging has
been configured by Torque.
2003-02-10 09:21:07,246 [main] DEBUG org.apache.torque.Torque - Starting
initAdapters
2003-02-10 09:21:07,324 [main] DEBUG org.apache.torque.Torque - Starting
initDSF
2003-02-10 09:21:07,324 [main] DEBUG org.apache.torque.Torque - handle:
default DataSourceFactory: org.apache.torque.dsfactory.JndiDataSourceFactory
2003-02-10 09:21:07,339 [main] DEBUG
org.apache.torque.dsfactory.JndiDataSourceFactory - Starting initJNDI
2003-02-10 09:21:07,339 [main] DEBUG
org.apache.torque.dsfactory.JndiDataSourceFactory - JNDI path: jdbc/fortius
2003-02-10 09:21:07,339 [main] DEBUG
org.apache.torque.dsfactory.JndiDataSourceFactory - Created new
InitialContext
2003-02-10 09:21:07,339 [main] DEBUG
org.apache.torque.dsfactory.JndiDataSourceFactory - InitialContext
-------------------------------
2003-02-10 09:21:07,339 [main] DEBUG
org.apache.torque.dsfactory.JndiDataSourceFactory - Environment properties:2
2003-02-10 09:21:07,339 [main] DEBUG
org.apache.torque.dsfactory.JndiDataSourceFactory -
java.naming.factory.initial: org.apache.naming.java.javaURLContextFactory
2003-02-10 09:21:07,339 [main] DEBUG
org.apache.torque.dsfactory.JndiDataSourceFactory -
java.naming.factory.url.pkgs: org.apache.naming
2003-02-10 09:21:07,339 [main] DEBUG
org.apache.torque.dsfactory.JndiDataSourceFactory -
----------------------------------------------
2003-02-10 09:21:07,339 [main] DEBUG
org.apache.torque.dsfactory.JndiDataSourceFactory - Starting initDataSources

However, I get a null connection object.  In my torque.properties I have:

torque.database.default.adapter=mssql
torque.dsfactory.default.factory=org.apache.torque.dsfactory.JndiDataSourceF
actory
torque.dsfactory.default.jndi.path=jdbc/fortius

And in my web.xml:

<resource-ref>
  <description>
    Resource reference to a factory for java.sql.Connection
    instances that may be used for talking to a particular
    database that is configured in the server.xml file.
  </description>
  <res-ref-name>
    jdbc/fortius
  </res-ref-name>
  <res-type>
    org.apache.torque.pool.TorqueClassicDataSource
  </res-type>
  <res-auth>
    Container
  </res-auth>
</resource-ref>

Plus in server.xml I have:

      <Resource name="jdbc/fortius" scope="Shareable"
type="javax.sql.DataSource"/>
          <ResourceParams name="jdbc/fortius">
            <parameter>
              <name>validationQuery</name>
              <value>SELECT 1</value>
            </parameter>
            <parameter>
              <name>maxWait</name>
              <value>5000</value>
            </parameter>
            <parameter>
              <name>maxActive</name>
              <value>4</value>
            </parameter>
            <parameter>
              <name>password</name>
              <value>XXXXXX</value>
            </parameter>
            <parameter>
              <name>url</name>
 
<value>jdbc:microsoft:sqlserver://cuzco:1433;DatabaseName=fortius;SelectMeth
od=cursor</value>
            </parameter>
            <parameter>
              <name>driverClassName</name>
              <value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value>
            </parameter>
            <parameter>
              <name>maxIdle</name>
              <value>2</value>
            </parameter>
            <parameter>
              <name>username</name>
              <value>SilverUserLogin</value>
            </parameter>
          </ResourceParams>

If anyone can post a working version, I promise to convert it to a WIKI
page!

Thanks,
Eric Pugh

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message