private void open() { try { conn = JdbcUtils.getConnection(driver, url, user, password); } catch (SQLException e) { throw DbException.convert(e); } }
/** * Closes the connection if this is the last link to it. * * @param force if the connection needs to be closed even if it is still used elsewhere (for * example, because the connection is broken) */ synchronized void close(boolean force) { if (--useCounter <= 0 || force) { JdbcUtils.closeSilently(conn); synchronized (map) { map.remove(this); } } }