Are you sure that "pc.close()" closes the pooled connection? The meaning is pc.close() pushes the connection back to the pool !
Main Topics
Browse All TopicsHow can we implement connection pooling both at the database level(Oracle connection pooling) and at the application level(java connection pooling).The application is written in java.
Which is the better practice?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Please update and finalize this old, open question. Please:
1) Award points ... if you need Moderator assistance to split points, comment here with details please or advise us in Community Support with a zero point question and this question link.
2) Ask us to delete it if it has no value to you or others
3) Ask for a refund so that we can move it to our PAQ at zero points if it did not help you but may help others.
EXPERT INPUT WITH CLOSING RECOMMENDATIONS IS APPRECIATED IF ASKER DOES NOT RESPOND.
Thanks,
** Mindphaser - Community Support Moderator **
P.S. Click your Member Profile, choose View Question History to go through all your open and locked questions to update them.
Business Accounts
Answer for Membership
by: renurajPosted on 2001-06-18 at 05:51:43ID: 6202165
The concept of connection pooling is not relevant to the server-side internal driver, where you are simply using the default connection, and is only relevant to the server-side Thin driver within a single session.
urce instance urce ocpds = urce();
oci8:@"); ;
);
A simple Pooled Connection Sample
import java.sql.*;
import javax.sql.*;
import oracle.jdbc.driver.*;
import oracle.jdbc.pool.*;
class PooledConnection1
{
public static void main (String args [])
throws SQLException
{
// Create a OracleConnectionPoolDataSo
OracleConnectionPoolDataSo
new OracleConnectionPoolDataSo
// Set connection parameters
ocpds.setURL("jdbc:oracle:
ocpds.setUser("scott");
ocpds.setPassword("tiger")
// Create a pooled connection
PooledConnection pc = ocpds.getPooledConnection(
// Get a Logical connection
Connection conn = pc.getConnection();
// Create a Statement
Statement stmt = conn.createStatement ();
// Select the ENAME column from the EMP table
ResultSet rset = stmt.executeQuery ("select ENAME from EMP");
// Iterate through the result and print the employee names
while (rset.next ())
System.out.println (rset.getString (1));
// Close the RseultSet
rset.close();
rset = null;
// Close the Statement
stmt.close();
stmt = null;
// Close the logical connection
conn.close();
conn = null;
// Close the pooled connection
pc.close();
pc = null;
}
}
Regards,