Sorry, make sure top use commons-dbcp and pooling in tomcat's common/lib.
Since Tomcat JNDI is tomcat's not struts'.

Regards,
 
 
PQ
 
"This Guy Thinks He Knows Everything"
"This Guy Thinks He Knows What He Is Doing"

-----Original Message-----
From: Raible, Matt [mailto:[EMAIL PROTECTED] 
Sent: February 26, 2003 5:24 PM
To: 'Struts Users Mailing List'
Subject: RE: Tomcat 4.1.18, DBCP, DataSources - What are people using?

I use Tomcat's JNDI database, not struts - my config is below.  Make sure
that classes12.jar is in common/lib.

Matt

web.xml
    <resource-ref>
        <description>DB Connection</description>
        <res-ref-name>jdbc/mydb</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
    </resource-ref>

webapps/mycontext.xml
    <Resource name="jdbc/mydb" auth="Container"
type="javax.sql.DataSource"/>

    <ResourceParams name="jdbc/mydb">
        <parameter>
            <name>factory</name>
            <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
        </parameter>
        <!-- Maximum number of dB connections in pool. 
            Set to 0 for no limit. -->
        <parameter>
            <name>maxActive</name>
            <value>50</value>
        </parameter>
        <!-- Maximum number of idle dB connections to retain in pool.
            Set to 0 for no limit. -->
        <parameter>
            <name>maxIdle</name>
            <value>10</value>
        </parameter>
        <!-- Maximum time to wait for a dB connection to become available
             in ms, in this example 10 seconds. An Exception is thrown if
             this timeout is exceeded.  Set to -1 to wait indefinitely. -->
        <parameter>
            <name>maxWait</name>
            <value>10000</value>
        </parameter>
        <!-- Database username and password for connections  -->
        <parameter>
            <name>username</name>
            <value>username</value>
        </parameter>
        <parameter>
            <name>password</name>
            <value>password</value>
        </parameter>
        <!-- Class name for Oracle JDBC driver -->
        <parameter>
            <name>driverClassName</name>
            <value>oracle.jdbc.pool.OracleConnectionPoolDataSource</value>
        </parameter>
        <!-- The JDBC connection url for connecting to your db. -->
        <parameter>
            <name>url</name>
            <value>jdbc:oracle:thin:@hostname:1521:SID</value>
        </parameter>
        <parameter>
            <name>removeAbandoned</name>
            <value>true</value>
        </parameter>
        <parameter>
            <name>removeAbandonedTimeout</name>
            <value>60</value>
        </parameter>
        <parameter>
            <name>logAbandoned</name>
            <value>true</value>
        </parameter>
        <parameter>
            <name>validationQuery</name>
            <value>SELECT 1 FROM DUAL</value>
        </parameter>
    </ResourceParams>

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 26, 2003 3:15 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Tomcat 4.1.18, DBCP, DataSources - What are people using?
> 
> 
> Make sure commons-dbcp and pooling are not in your common/lib, use
> tomcat's.
> 
> Besides, I don't use struts datasource, I use Tomcat JNDI 
> datasource and
> pooling.
> 
> Regards,
>  
>  
> PQ
>  
> "This Guy Thinks He Knows Everything"
> "This Guy Thinks He Knows What He Is Doing"
> 
> -----Original Message-----
> From: David Haynes [mailto:[EMAIL PROTECTED] 
> Sent: February 26, 2003 5:12 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Tomcat 4.1.18, DBCP, DataSources - What are people using?
> 
> I'm setting up named data sources with the following:
> <data-sources>
>       <data-source key="eha"
> type="org.apache.commons.dbcp.BasicDataSource">
>               <set-property property="autoCommit"
>                       value="false"/>
>               <set-property property="description"
>                       value="EHA Definition"/>
>               <set-property property="driverClass"
>                       value="oracle.jdbc.driver.OracleDriver"/>
>               <set-property property="maxCount"
>                       value="4"/>
>               <set-property property="minCount"
>                       value="2"/>
>               <set-property property="url"
>       
> value="jdbc:oracle:thin:@citation:1521/citation"/>
>               <set-property property="user"
>                       value="david"/>
>               <set-property property="password"
>                       value="secret"/>
>       </data-source>
> </data-sources>
> 
> In my Action, I reference this as:
> DataSource ds = getDataSource(req, "eha");
> 
> Tomcat reports the following in catalina.out:
> SQLException: Cannot load JDBC driver class 'null'
> 
> -david-
> 
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: February 26, 2003 4:55 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Tomcat 4.1.18, DBCP, DataSources - What are people using?
> 
> What is the bug that you discovered? Mine works just fine.
> 
> Tomcat 4.1.18
> Struts 1.1-rc1
> Oracle 8i
> 
> Regards,
>  
>  
> PQ
>  
> "This Guy Thinks He Knows Everything"
> "This Guy Thinks He Knows What He Is Doing"
> 
> -----Original Message-----
> From: David Haynes [mailto:[EMAIL PROTECTED] 
> Sent: February 26, 2003 4:43 PM
> To: [EMAIL PROTECTED]
> Subject: Tomcat 4.1.18, DBCP, DataSources - What are people using?
> 
> After working on this for most of the day, I have discovered 
> that Tomcat
> 4.1.18 and DBCP do not play well together. There is a bug 
> against Tomcat
> for this (I have *got* to remember to check the bugs databases sooner
> ;-) ), but no analysis or corrective action has been recorded to date.
>  
> So, my question is this. "What are people using for their DataSource?"
>  
> My environment is:
> Tomcat 4.1.18
> Struts 1.1rc1
> Oracle 9i
> JDBC
>  
> Thanks!
> -david-
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to