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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Connection Pooling" Watch "Connection Pooling" New topic
Author

Connection Pooling

Naresh Chaurasia
Ranch Hand

Joined: May 18, 2005
Posts: 356
I am trying to understand the concept of connection pooling. When a connection is obtained from pool, how many statements can be created from a connection, how many resultset can be created from a statement, thread safe concepts and connection pool management. Can some one point to good resource which explains these concepts with some example (opening/closing of connection, statment, resultset etc. )


SCJP 1.4, SCWCD1.4, OCA(1Z0-007)
amit punekar
Ranch Hand

Joined: May 14, 2004
Posts: 514
Hello,
Please refer java.sql.Statement

By default, only one ResultSet object per Statement object can be open at the same time. Therefore, if the reading of one ResultSet object is interleaved with the reading of another, each must have been generated by different Statement objects. All execution methods in the Statement interface implicitly close a statment's current ResultSet object if an open one exists.


Regards,
Amit
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18655
    
    8

Naresh Chaurasia wrote:When a connection is obtained from pool, how many statements can be created from a connection, how many resultset can be created from a statement...


The same as when the connection is not obtained from the pool. Why would there be a difference? The only difference is that you don't create the connection yourself, the pool creates it and gives it to you when you ask for one. So if you're looking for a resource which explains all those things, the ordinary JDBC tutorial is just fine.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connection Pooling