You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Jonas Björnerstedt <li...@bjornerstedt.org> on 2003/06/13 16:32:50 UTC

[DBCP] Data source configuration

Hello,

I would like to initialize my connection pool in an application using
something like struts-config.xml instead of jocl. I haven't found anything
in the Commons archive or the documentation on this. Looking at the Struts
code, it seems like a bit of work to factor out the code from the
org.apache.struts.config package. It would be kind of silly to start doing
this if it had already been done. Although the code is in Struts, the
question concerns the pool, so I post it here.

Jonas


Re: [DBCP] Data source configuration

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Fri, 13 Jun 2003, Jonas Björnerstedt wrote:

> Date: Fri, 13 Jun 2003 16:32:50 +0200
> From: Jonas Björnerstedt <li...@bjornerstedt.org>
> Reply-To: Jakarta Commons Users List <co...@jakarta.apache.org>
> To: commons-user@jakarta.apache.org
> Subject: [DBCP] Data source configuration
>
> Hello,
>
> I would like to initialize my connection pool in an application using
> something like struts-config.xml instead of jocl. I haven't found anything
> in the Commons archive or the documentation on this. Looking at the Struts
> code, it seems like a bit of work to factor out the code from the
> org.apache.struts.config package. It would be kind of silly to start doing
> this if it had already been done. Although the code is in Struts, the
> question concerns the pool, so I post it here.
>

If you start from something like org.apache.commons.dbcp.BasicDataSource,
all you need to do is instantiate the bean and then configure it's
properties before you call getConnection() the first time.  Where you get
the configuration property values is up to you, but there is nothing magic
here.

> Jonas

Craig