here is my code of OracleConnectionPool
package com.gtl.database;
import java.util.*;
import java.sql.*;
import javax.sql.*;
import oracle.jdbc.driver.*;
import oracle.jdbc.pool.*;
public class OracleConnectionPool
{
private int size=1;
private PooledConnection pc;
private ReadFile rf;
public synchronized void initializePool() throws Exception
{
DriverManager.registerDriver(new
oracle.jdbc.driver.OracleDriver());
Class.forName("oracle.jdbc.driver.OracleDriver");
// Create a OracleConnectionPoolDataSource instance
OracleConnectionPoolDataSource ocpds = new
OracleConnectionPoolDataSource();
// Set connection parameters
ocpds.setURL("jdbc:oracle:thin:@prasanna:1521:mis");
ocpds.setUser("CORPMIS");
ocpds.setPassword("CORPMIS");
// Create a pooled connection
pc = ocpds.getPooledConnection();
//Connection conn = null;
System.out.println("OPENING CONNECTION************* ");
}
public synchronized OracleConnection getConnection() throws
SQLException {
return (OracleConnection)pc.getConnection();
}
public synchronized void releaseConnection(OracleConnection conn){
try {
// Close the logical connection
conn.close();
conn = null;
}
catch (Exception e){
e.printStackTrace();
}
}
public synchronized void emptyPool() throws SQLException {
// Close the pooled connection
pc.close();
pc = null;
}
}
Regards,
Vikramjit Singh,
Systems Engineer,
GTL Ltd.
Ph. 7612929-1031
-----Original Message-----
From: Power-Netz (Schwarz) [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 2:36 AM
To: [EMAIL PROTECTED]
Subject: AW: driver manager does not work neither giving error
You should post the code before it too! Noone else knows what you
have written there!
> In my OracleConnectionPool.java these lines are not being reached:
>
> DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
> Class.forName("oracle.jdbc.driver.OracleDriver");
>
> and after these lines the connection pooling methods of Oracle driver is
> called.
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com