|
| Connection pooling |
 |
Fri, 16 Mar 2007 08:20:42 EDT |
Hi
We are trying to implement JDBC connection pooling in java program. We use the
DB2 v 8.2. We are using com.ibm.db2.jdbc.app.db2driver. Inorder to implement the
connection pooling we are using a logic below
com.ibm.db2.jdbc.DB2ConnectionPoolDataSource db2cpds = new
com.ibm.db2.jdbc.DB2ConnectionPoolDataSource();
db2cpds.setDatabaseName("database");
db2cpds.setUser("username");
db2cpds.setPassword("password");
db2cpds.setConnectionAttribute("url");
db2PooledCon =
(com.ibm.db2.jdbc.DB2PooledConnection)db2cpds.getPooledConnection();
and for every connection we obtain we use
db2PooledCon.getConnection();
Is this a right way to use the connection pooling or do we have some other
better way of doing this like changing the driver or any other.
As I am new to the connection pooling in db2, I am not able to find out whether
this is the way we should use this?
Is there any thing analogous to OracleCacheImpl class in db2 to take in the
factory class?
Could any body please suggest.
Thanks in advance
|
| Post Reply
|
| Re: Connection pooling |
 |
Fri, 16 Mar 2007 18:37:10 +010 |
vvgangadharsonti@gmail.com wrote:
> Hi
>
> We are trying to implement JDBC connection pooling in java program. We
> use the DB2 v 8.2. We are using com.ibm.db2.jdbc.app.db2driver. Inorder
> to implement the connection pooling we are using a logic below
>
> com.ibm.db2.jdbc.DB2ConnectionPoolDataSource db2cpds = new
> com.ibm.db2.jdbc.DB2ConnectionPoolDataSource();
> db2cpds.setDatabaseName("database");
> db2cpds.setUser("username");
> db2cpds.setPassword("password");
> db2cpds.setConnectionAttribute("url");
>
> db2PooledCon =
>
(com.ibm.db2.jdbc.DB2PooledConnection)db2cpds.getPooledConnection();
>
> and for every connection we obtain we use
>
> db2PooledCon.getConnection();
>
> Is this a right way to use the connection pooling or do we have some other
> better way of doing this like changing the driver or any other.
>
> As I am new to the connection pooling in db2, I am not able to find out
> whether this is the way we should use this? Is there any thing analogous
> to OracleCacheImpl class in db2 to take in the factory class?
>
> Could any body please suggest.
You should ask your question in a JDBC/DB2 newsgroup. This group is
dedicated to the DB2 Spatial Extender.
--
Knut Stolze
DB2 z/OS Admin Enablement
|
| Post Reply
|
|
|
|
|
|
|
|
|
|