con = m_ConnectionPool.getConnection(); m_ConnectionPool.releaseConnectionOnError(con); con = null; if ( con != null ) m_ConnectionPool.releaseConnection(con);
/** * Remove a pool from the global table. If the pool still has * active connections, then only mark this pool as inactive and * leave it around until all the existing connections are closed. * @param name * */ public synchronized void removePool( String name ) { ConnectionPool pool = getPool(name); if (null != pool) { // // Disable future use of this pool under the Xalan // extension only. This flag should only exist in the // wrapper and not in the actual pool implementation. pool.setPoolEnabled(false); // // Remove the pool from the Hashtable if we don'd have // any active connections. // if ( ! pool.hasActiveConnections() ) m_poolTable.remove(name); } }
if (pool.testConnection())
if (m_HasErrors) m_ConnectionPool.releaseConnectionOnError(conn); else m_ConnectionPool.releaseConnection(conn);
/** * See enableDefaultConnectionPool * * @deprecated Use setFeature("default-pool-enabled", "false"); */ public void disableDefaultConnectionPool( ) { if (DEBUG) System.out.println("Disabling Default Connection Pool"); m_DefaultPoolingEnabled = false; if (m_ConnectionPool == null) return; if (!m_IsDefaultPool) return; m_ConnectionPool.setPoolEnabled(false); }
private void executeSQLStatement() throws SQLException { m_ConnectionPool = m_XConnection.getConnectionPool(); Connection conn = m_ConnectionPool.getConnection(); if (! m_QueryParser.hasParameters() ) { m_Statement = conn.createStatement(); m_ResultSet = m_Statement.executeQuery(m_QueryParser.getSQLQuery()); } else if (m_QueryParser.isCallable()) { CallableStatement cstmt = conn.prepareCall(m_QueryParser.getSQLQuery()); m_QueryParser.registerOutputParameters(cstmt); m_QueryParser.populateStatement(cstmt, m_ExpressionContext); m_Statement = cstmt; if (! cstmt.execute()) throw new SQLException("Error in Callable Statement"); m_ResultSet = m_Statement.getResultSet(); } else { PreparedStatement stmt = conn.prepareStatement(m_QueryParser.getSQLQuery()); m_QueryParser.populateStatement(stmt, m_ExpressionContext); m_Statement = stmt; m_ResultSet = stmt.executeQuery(); } }
m_ConnectionPool.releaseConnection(m_Connection); m_Connection = null;
if (m_HasErrors) m_ConnectionPool.releaseConnectionOnError(conn); else m_ConnectionPool.releaseConnection(conn);
/** * There is a problem with some JDBC drivers when a Connection * is open and the JVM shutsdown. If there is a problem, there * is no way to control the currently open connections in the * pool. So for the default connection pool, the actuall pooling * mechinsm is disabled by default. The Stylesheet designer can * re-enabled pooling to take advantage of connection pools. * The connection pool can even be disabled which will close all * outstanding connections. * * @deprecated Use setFeature("default-pool-enabled", "true"); */ public void enableDefaultConnectionPool( ) { if (DEBUG) System.out.println("Enabling Default Connection Pool"); m_DefaultPoolingEnabled = true; if (m_ConnectionPool == null) return; if (m_IsDefaultPool) return; m_ConnectionPool.setPoolEnabled(true); }
private void executeSQLStatement() throws SQLException { m_ConnectionPool = m_XConnection.getConnectionPool(); Connection conn = m_ConnectionPool.getConnection(); if (! m_QueryParser.hasParameters() ) { m_Statement = conn.createStatement(); m_ResultSet = m_Statement.executeQuery(m_QueryParser.getSQLQuery()); } else if (m_QueryParser.isCallable()) { CallableStatement cstmt = conn.prepareCall(m_QueryParser.getSQLQuery()); m_QueryParser.registerOutputParameters(cstmt); m_QueryParser.populateStatement(cstmt, m_ExpressionContext); m_Statement = cstmt; if (! cstmt.execute()) throw new SQLException("Error in Callable Statement"); m_ResultSet = m_Statement.getResultSet(); } else { PreparedStatement stmt = conn.prepareStatement(m_QueryParser.getSQLQuery()); m_QueryParser.populateStatement(stmt, m_ExpressionContext); m_Statement = stmt; m_ResultSet = stmt.executeQuery(); } }
m_ConnectionPool.releaseConnection(m_Connection); m_Connection = null;
con = m_ConnectionPool.getConnection(); m_ConnectionPool.releaseConnectionOnError(con); con = null; if ( con != null ) m_ConnectionPool.releaseConnection(con);
/** * Remove a pool from the global table. If the pool still has * active connections, then only mark this pool as inactive and * leave it around until all the existing connections are closed. * @param name * */ public synchronized void removePool( String name ) { ConnectionPool pool = getPool(name); if (null != pool) { // // Disable future use of this pool under the Xalan // extension only. This flag should only exist in the // wrapper and not in the actual pool implementation. pool.setPoolEnabled(false); // // Remove the pool from the Hashtable if we don'd have // any active connections. // if ( ! pool.hasActiveConnections() ) m_poolTable.remove(name); } }
if (m_HasErrors) m_ConnectionPool.releaseConnectionOnError(conn); else m_ConnectionPool.releaseConnection(conn);
if (m_IsDefaultPool) return; m_ConnectionPool.setPoolEnabled(value);
private void executeSQLStatement() throws SQLException { m_ConnectionPool = m_XConnection.getConnectionPool(); Connection conn = m_ConnectionPool.getConnection(); if (! m_QueryParser.hasParameters() ) { m_Statement = conn.createStatement(); m_ResultSet = m_Statement.executeQuery(m_QueryParser.getSQLQuery()); } else if (m_QueryParser.isCallable()) { CallableStatement cstmt = conn.prepareCall(m_QueryParser.getSQLQuery()); m_QueryParser.registerOutputParameters(cstmt); m_QueryParser.populateStatement(cstmt, m_ExpressionContext); m_Statement = cstmt; if (! cstmt.execute()) throw new SQLException("Error in Callable Statement"); m_ResultSet = m_Statement.getResultSet(); } else { PreparedStatement stmt = conn.prepareStatement(m_QueryParser.getSQLQuery()); m_QueryParser.populateStatement(stmt, m_ExpressionContext); m_Statement = stmt; m_ResultSet = stmt.executeQuery(); } }
m_ConnectionPool.releaseConnection(m_Connection); m_Connection = null;
con = m_ConnectionPool.getConnection(); m_ConnectionPool.releaseConnectionOnError(con); con = null; if ( con != null ) m_ConnectionPool.releaseConnection(con);
/** * Remove a pool from the global table. If the pool still has * active connections, then only mark this pool as inactive and * leave it around until all the existing connections are closed. * @param name * */ public synchronized void removePool( String name ) { ConnectionPool pool = getPool(name); if (null != pool) { // // Disable future use of this pool under the Xalan // extension only. This flag should only exist in the // wrapper and not in the actual pool implementation. pool.setPoolEnabled(false); // // Remove the pool from the Hashtable if we don'd have // any active connections. // if ( ! pool.hasActiveConnections() ) m_poolTable.remove(name); } }