Ejemplo n.º 1
0
  // Release the given database resources, if non-null.
  private static void releaseDatabaseResources(Connection dbConn, PreparedStatement ps) {
    if (ps != null) {
      try {
        ps.close();
      } catch (Exception e) {
        Debug.warning("Failed to close the prepared statement:\n" + e.toString());
      }
    }

    if (dbConn != null) {
      try {
        DBConnectionPool.getInstance().releaseConnection(dbConn);
      } catch (Exception e) {
        Debug.warning("Failed to release database connection back to the pool:\n" + e.toString());
      }
    }
  }