Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

DB2 Pool Data  RSS feed

Vikram Anand
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to use the pool data in Db2
Oracle gives the code as simple as
* 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 OracleConnectionPoolDataSource instance
OracleConnectionPoolDataSource ocpds =
new OracleConnectionPoolDataSource();
// Set connection parameters
ocpds.setURL("jdbc racle ci8:@");
// 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 ( ())
System.out.println (rset.getString (1));
// Close the RseultSet
rset = null;
// Close the Statement
stmt = null;
// Close the logical connection
conn = null;
// Close the pooled connection
pc = null;

can any one help me for DB2.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!