Struts support for the <data-sources> element (which, by the way, is
pooled) is deprecated -- the recommended practice is to use your
container's ability to configure a JNDI based data source, and then
access it using standard JNDI APIs.  Examples of that (which are
portable to all JNDI based servers) can be found in the Tomcat docs
at:

  http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-resources-howto.html

Scroll down to the section on "JDBC Data Sources"

Craig

On Fri, 21 Jan 2005 14:41:44 -0600, Scott Purcell
<[EMAIL PROTECTED]> wrote:
> Hello,
> 
> I am just getting underway with Struts, but have done quite a bit of homework 
> before submitting this query.
> 
> Before starting with struts, I configured my Tomcat server to handle DBCP 
> through the server.xml for a web-app I configured. But now with struts, I 
> notice that there is a <data-sources> element that must be filled in.
> So according to the docs, for basic (not pooled)
> <data-sources>
> <!-- configuration for commons BasicDataSource -->
>   <data-source type="org.apache.commons.dbcp.BasicDataSource">
>       <set-property
>         property="driverClassName"
>         value="org.postgresql.Driver" />
>       <set-property
>         property="url"
>         value="jdbc:postgresql://localhost/mydatabase" />
>       <set-property
>         property="username"
>         value="me" />
>       <set-property
>         property="password"
>         value="test" />
>       <set-property
>         property="maxActive"
>         value="10" />
>       <set-property
>         property="maxWait"
>         value="5000" />
>       <set-property
>         property="defaultAutoCommit"
>         value="false" />
>       <set-property
>         property="defaultReadOnly"
>         value="false" />
>       <set-property
>         property="validationQuery"
>         value="SELECT COUNT(*) FROM market" />
>      </data-source>
>   </data-sources>
> 
> But my question of course, is I need the database pooling capability. How do 
> I configure that and access connections? I have googled, but I am getting 
> quite a bit of subjective matter back.
> 
> Could someone please lend a hand?
> 
> Thanks,
> 
> Scott K Purcell | Developer | VERTIS |
> 555 Washington Ave. 4th Floor | St. Louis, MO 63101 |
> 314.588.0720 Ext:1320 | [EMAIL PROTECTED] | http://www.vertisinc.com 
> <http://www.vertisinc.com/>
> 
> Vertis is the premier provider of targeted advertising, media, and
> marketing services that drive consumers to marketers more effectively.
> 
>

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

Reply via email to