/** * Closes the physical database connection represented by this PooledConnection. If any client has * a connection based on this PooledConnection, it is forcibly closed as well. */ @Override public void close() throws SQLException { if (last != null) { last.close(); if (!con.isClosed()) { if (!con.getAutoCommit()) { try { con.rollback(); } catch (SQLException ignored) { } } } } try { con.close(); } finally { con = null; } }
last.close(); if (!con.getAutoCommit()) { try { throw (SQLException) sqlException.fillInStackTrace(); ConnectionHandler handler = new ConnectionHandler(con); last = handler; last.setProxy(proxyCon); return proxyCon;
return con.getProxy(); // the proxied connection, not a physical connection