コード例 #1
0
 private void open() {
   try {
     conn = JdbcUtils.getConnection(driver, url, user, password);
   } catch (SQLException e) {
     throw DbException.convert(e);
   }
 }
コード例 #2
0
 /**
  * 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);
     }
   }
 }