if ( pcon.inUse() == false ) pcon.setInUse(true); return pcon.getConnection(); pcon = new PooledConnection(con); pcon.setInUse(true); return pcon.getConnection();
/** * Go through the connection pool and release any connections * that are not InUse; * */ public void freeUnused( ) { // Iterate over the entire pool closing the // JDBC Connections. Iterator i = m_pool.iterator(); while(i.hasNext()) { PooledConnection pcon = (PooledConnection) i.next(); // If the PooledConnection is not in use, close it if ( pcon.inUse() == false ) { if (DEBUG) { System.err.println("Closing JDBC Connection "); } pcon.close(); i.remove(); } } }
if ( pcon.getConnection() == con ) pcon.setInUse(false);
/** * @param con * * @throws SQLException */ public synchronized void releaseConnectionOnError( Connection con )throws SQLException { // find the PooledConnection Object for ( int x = 0; x < m_pool.size(); x++ ) { PooledConnection pcon = (PooledConnection) m_pool.elementAt(x); // Check for correct Connection if ( pcon.getConnection() == con ) { if (DEBUG) { System.out.println("Releasing Connection On Error" + x); } con.close(); m_pool.removeElementAt(x); if (DEBUG) { System.out.println("-->Inactive Pool, Closing connection"); } break; } } }
PooledConnection pcon = new PooledConnection(con);
if ( pcon.getConnection() == con ) pcon.setInUse(false);
/** * @param con * * @throws SQLException */ public synchronized void releaseConnectionOnError( Connection con )throws SQLException { // find the PooledConnection Object for ( int x = 0; x < m_pool.size(); x++ ) { PooledConnection pcon = (PooledConnection) m_pool.elementAt(x); // Check for correct Connection if ( pcon.getConnection() == con ) { if (DEBUG) { System.out.println("Releasing Connection On Error" + x); } con.close(); m_pool.removeElementAt(x); if (DEBUG) { System.out.println("-->Inactive Pool, Closing connection"); } break; } } }
PooledConnection pcon = new PooledConnection(con);
if ( pcon.inUse() == false ) pcon.setInUse(true); return pcon.getConnection(); pcon = new PooledConnection(con); pcon.setInUse(true); return pcon.getConnection();
if ( pcon.getConnection() == con ) pcon.setInUse(false);
/** * @param con * * @throws SQLException */ public synchronized void releaseConnectionOnError( Connection con )throws SQLException { // find the PooledConnection Object for ( int x = 0; x < m_pool.size(); x++ ) { PooledConnection pcon = (PooledConnection) m_pool.elementAt(x); // Check for correct Connection if ( pcon.getConnection() == con ) { if (DEBUG) { System.out.println("Releasing Connection On Error" + x); } con.close(); m_pool.removeElementAt(x); if (DEBUG) { System.out.println("-->Inactive Pool, Closing connection"); } break; } } }
PooledConnection pcon = new PooledConnection(con);
if ( pcon.inUse() == false ) pcon.setInUse(true); return pcon.getConnection(); pcon = new PooledConnection(con); pcon.setInUse(true); return pcon.getConnection();
/** * Go through the connection pool and release any connections * that are not InUse; * */ public void freeUnused( ) { // Iterate over the entire pool closing the // JDBC Connections. Iterator i = m_pool.iterator(); while(i.hasNext()) { PooledConnection pcon = (PooledConnection) i.next(); // If the PooledConnection is not in use, close it if ( pcon.inUse() == false ) { if (DEBUG) { System.err.println("Closing JDBC Connection "); } pcon.close(); i.remove(); } } }
if ( pcon.getConnection() == con ) pcon.setInUse(false);
/** * @param con * * @throws SQLException */ public synchronized void releaseConnectionOnError( Connection con )throws SQLException { // find the PooledConnection Object for ( int x = 0; x < m_pool.size(); x++ ) { PooledConnection pcon = (PooledConnection) m_pool.elementAt(x); // Check for correct Connection if ( pcon.getConnection() == con ) { if (DEBUG) { System.out.println("Releasing Connection On Error" + x); } con.close(); m_pool.removeElementAt(x); if (DEBUG) { System.out.println("-->Inactive Pool, Closing connection"); } break; } } }
PooledConnection pcon = new PooledConnection(con);
if ( pcon.inUse() == false ) pcon.setInUse(true); return pcon.getConnection(); pcon = new PooledConnection(con); pcon.setInUse(true); return pcon.getConnection();