aspose file tools*
The moose likes JDBC and the fly likes JDBC connection pool Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC connection pool" Watch "JDBC connection pool" New topic
Author

JDBC connection pool

Shubhashis Dasgupta
Greenhorn

Joined: Jul 27, 2001
Posts: 9
Hi all,
I have a question on JDBC connection pools. I have created a connection pool in WebLogic Server and using it from my application. As we know, in case of hand-coded connection pools we release the connection to the pool, once it is used. How do we release a connection in case of server specific connection pool. I am getting the connection object from a datasource related to the connection pool that I have created in WLS. I do not know how to release it.
Shubhashis
subramaniam vaidyanathan
Greenhorn

Joined: Jun 25, 2001
Posts: 10
I work with weblogic server. Here is how I get a connection:
<code>
DataSource ds = (DataSource) ctx.lookup (dsJNDIName);
conn = ds.getConnection();
</code>
and when I am done with it I just close the connection. The welogic server actually releases it.
<code>conn.close();</code>
Basically leave it to the app server to manage the pool.
tim lok
Greenhorn

Joined: Mar 19, 2001
Posts: 4
If you use Oracle, you can close the resultset as well.
resultSet.getStatement().close();
In doing so, you should be able to prevent any unclosed cursor.
Originally posted by Shubhashis Dasgupta:
Hi all,
I have a question on JDBC connection pools. I have created a connection pool in WebLogic Server and using it from my application. As we know, in case of hand-coded connection pools we release the connection to the pool, once it is used. How do we release a connection in case of server specific connection pool. I am getting the connection object from a datasource related to the connection pool that I have created in WLS. I do not know how to release it.
Shubhashis

Shubhashis Dasgupta
Greenhorn

Joined: Jul 27, 2001
Posts: 9
Thax tim, subramaniam.
Actually I was not very sure that closing a connection really leads to releasing it to the pool by app. server itself.
Tim Chen
Greenhorn

Joined: Aug 06, 2001
Posts: 2
Here's the weblogic documentation proof of what happens when you close a connection.
http://e-docs.bea.com/wls/docs60////jdbc/performance.html#1023983
it basically says:
"When a client closes a connection from a connection pool, the connection is returned to the pool and becomes available for other clients; the connection itself is not closed"


AOL IM sn: CrashedDrive
Vishakha Ahuja
Ranch Hand

Joined: Sep 13, 2000
Posts: 191
Hi,
I want to know in what ways is a single connection different from a connection pool ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC connection pool
 
Similar Threads
sun one app server and connection pool
Can I get a database pool with JNDI?
Sun one application server and connection pool
Hibernate dialect
Session Listener