thrownewSQLException(automatic?"Connection has been closed automatically because a new connection was opened for the same PooledConnection or the PooledConnection has been closed":"Connection has been closed");
}
if(method.getName().equals("close")){
SQLExceptionex=null;
if(!con.getAutoCommit()){
try{con.rollback();}catch(SQLExceptione){ex=e;}
}
con.clearWarnings();
con=null;
last=null;
fireConnectionClosed();
if(ex!=null){
throwex;
}
returnnull;
}else{
returnmethod.invoke(con,args);
}
}
publicvoidclose(){
if(con!=null){
automatic=true;
}
con=null;
// No close event fired here: see JDBC 2.0 Optional Package spec section 6.3