You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by J Malcolm <te...@malcolms.com> on 2005/03/04 16:57:40 UTC

Single-Tag DataSource Definition?

I know the docs define a jdbc datasource using multiple nested tags, e.g.:

               <Resource name="jdbc/mail" auth="Container"
type="javax.sql.DataSource"/>

                <ResourceParams name="jdbc/mail">
                  <parameter>
                    <name>factory</name>
 
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
                  </parameter>

                  <parameter>
                    <name>maxActive</name>
                    <value>100</value>
                  </parameter>     etc.......

But somewhere I saw an alternate single-tag format:

               <Resource name="jdbc/mail" auth="Container"
type="javax.sql.DataSource"
factory="org.apache.commons.dbcp.BasicDataSourceFactory" maxActive="100"
maxIdle="30" maxWait="10000" username="?????" password="???????"
driverClassName="org.gjt.mm.mysql.Driver"
url="jdbc:mysql://localhost:3306/jbf?autoReconnect=true"/>

I don't remember where that originated, but it was in a supposedly running
environment.  I'd much prefer to use the single tag format if possible.
Problem is that it doesn't seem to work. Error says the class and url are
null.

Was I simply incorrect in thinking it was a working env, and it this
actually simply invalid syntax.  Or is it supported, perhaps in a later
version of Tomcat?  Or do you code the Java differently with the other
syntax?

Can someone educate me on this?

Thanks.

Jerry 


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


Re: Single-Tag DataSource Definition?

Posted by Parsons Technical Services <pa...@earthlink.net>.
Single tag for 5.5.x
Multiple for 5.0.x

Doug


----- Original Message ----- 
From: "J Malcolm" <te...@malcolms.com>
To: <to...@jakarta.apache.org>
Sent: Friday, March 04, 2005 10:57 AM
Subject: Single-Tag DataSource Definition?


>I know the docs define a jdbc datasource using multiple nested tags, e.g.:
>
>               <Resource name="jdbc/mail" auth="Container"
> type="javax.sql.DataSource"/>
>
>                <ResourceParams name="jdbc/mail">
>                  <parameter>
>                    <name>factory</name>
>
> <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
>                  </parameter>
>
>                  <parameter>
>                    <name>maxActive</name>
>                    <value>100</value>
>                  </parameter>     etc.......
>
> But somewhere I saw an alternate single-tag format:
>
>               <Resource name="jdbc/mail" auth="Container"
> type="javax.sql.DataSource"
> factory="org.apache.commons.dbcp.BasicDataSourceFactory" maxActive="100"
> maxIdle="30" maxWait="10000" username="?????" password="???????"
> driverClassName="org.gjt.mm.mysql.Driver"
> url="jdbc:mysql://localhost:3306/jbf?autoReconnect=true"/>
>
> I don't remember where that originated, but it was in a supposedly running
> environment.  I'd much prefer to use the single tag format if possible.
> Problem is that it doesn't seem to work. Error says the class and url are
> null.
>
> Was I simply incorrect in thinking it was a working env, and it this
> actually simply invalid syntax.  Or is it supported, perhaps in a later
> version of Tomcat?  Or do you code the Java differently with the other
> syntax?
>
> Can someone educate me on this?
>
> Thanks.
>
> Jerry
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
> 



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