}
/**
* Override this to return the connection to a pool, or to clean up the
* resource.
*
* The default behavior holds a single connection open until the appender
* is closed (typically when garbage collected).
*/
protected void closeConnection(Connection con) {
mydb=null;
try {
if (connection != null && !connection.isClosed())
connection.close();
} catch (SQLException e) {
errorHandler.error("Error closing connection", e,
ErrorCode.GENERIC_FAILURE);
}
}
/**
* Override 此函数来利用连接池返回一个Co.netion对象
*
*/
protected Connection getConnection() throws SQLException {
文章来源于领测软件测试网 https://www.ltesting.net/