Andreas, you should look at the commons DBCP (database connection
pooling) package. It wraps any JDBC driver to allow for connection
pooling. Read up on there site for examples.
http://jakarta.apache.org/commons
Michael, for the advantages, it mainly allows you to share the driver
connections with anything in your app. Right now you just have it set
up so that the Castor part of your app will use connection pooling,
which may be fine and you may not have any regular JDBC stuff in it at
all. But I personally use castor along with normal SQL calls in my
app, and would like to set up the conenction for both in one place so
I dont have to worry about it. Using JNDI allows for this, and has the
bonus of setting up connection pooling really easily.
Here's all I do to set up the connection to use in ANY part of my app:
<Resource name="jdbc/MyDatabase" auth="Container" type="javax.sql.DataSource"
factory="org.apache.commons.dbcp.BasicDataSourceFactory"
maxActive="#"
maxIdle="#"
maxWait="#"
username="myUser"
password="myPassword"
driverClassName="net.sourceforge.jtds.jdbc.Driver"
url="jdbc:jtds:sqlserver://<host>/<database>"/>
Hope this helps some.
On Wed, 15 Dec 2004 15:14:19 +0100, Andreas Vombach
<[EMAIL PROTECTED]> wrote:
>
> .. I use Oracle, I'm not sure if the JDBC driver supports pooling.
> All libraries are in place and unpooled connections work.
> I'm just trying to find out if it is a tomcat problem by testing a
> pooled con without castor ...
>
> Cheers Andreas
>
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-user
>
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-user