Closes the JDBC statement and its associated connection.
551903
public static void close(Statement stmt) {
    try {
      Connection conn = stmt.getConnection();
      try {
        if (!stmt.isClosed())
          stmt.close();
      } catch (UnsupportedOperationException e) {
        // not all JDBC drivers implement the isClosed() method.
        // ugly, but probably the only way to get around this.
        // http://stackoverflow.com/questions/12845385/duke-fast-deduplication-java-lang-unsupportedoperationexception-operation-not
        stmt.close();
      }
      if (conn != null && !conn.isClosed())
        conn.close();
    } catch (SQLException e) {
      throw new DukeException(e);
    }
  }
32397
@Override
    public void close() throws SQLException {
        if ((id == null) || (poolableConn == null)) {
            internalStmt.close();
        } else {
            poolableConn.cachePreparedStatement(this);
        }
    }
1344253
public void close() {
        while (getCurrentResultSet() != null) {
            try {
                closeResultSet(getCurrentResultSet());

                setCurrentResultSet(getNextResultSet());
            } catch (SQLException ex) {
                // considering that all ResultSets are closed
                setCurrentResultSet(null);
            }
        }

        MjdbcUtils.closeQuietly(stmt);
    }
834357
public void close() throws SQLException {

        validate();

        try {
            this.connection.rollback();
            this.connection.clearWarnings();
            this.connectionDefaults.setDefaults(this.connection);
            this.connection.reset();
            fireCloseEvent();
        } catch (SQLException e) {
            fireSqlExceptionEvent(e);

            throw e;
        }
    }
982439
public static void close(ResultSet rs) {
		Statement st = null;
		Connection con = null;
		try {
			try {
				if (rs != null) {
					st = rs.getStatement();
					rs.close();
				}
			} finally {
				try {
					if (st != null) {
						con = st.getConnection();
						st.close();
					}
				} finally {
					if (con != null) {
						con.close();
					}
				}
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
203931
public void destroy()
    {
        removeAllListeners();
        if (connectionManager != null)
        {
            if(connectionManager.isInLocalTransaction())
            {
                connectionManager.localRollback();
            }
            connectionManager.releaseConnection();
        }
        this.setClosed(true);

        this.descriptorRepository = null;
        this.pbKey = null;
        this.pbf = null;
        this.connectionManager = null;
        this.dbAccess = null;
        this.objectCache = null;
        this.sequenceManager = null;
        this.sqlGenerator = null;
        this.statementManager = null;
    }
52241
@Override
    public synchronized void close() {

        if (isClosed) {
            return;
        }

        rollback(false);

        try {
            database.logger.writeToLog(this, Tokens.T_DISCONNECT);
        } catch (HsqlException e) {}

        sessionData.closeAllNavigators();
        sessionData.persistentStoreCollection.clearAllTables();
        sessionData.closeResultCache();
        database.compiledStatementManager.removeSession(sessionId);
        database.sessionManager.removeSession(this);
        database.closeIfLast();

        database                  = null;
        user                      = null;
        rowActionList             = null;
        sessionContext.savepoints = null;
        intConnection             = null;
        sessionContext            = null;
        lastIdentity              = null;
        isClosed                  = true;
    }
629564
@Override
	public void close() {
		if (connection != null) {
			try {
				if (!isRollbackOnly()) {
					commit();
				} else {
					rollback();
				}
				connection.close();
			} catch (SQLException e) {
				throw new UroborosqlSQLException(e);
			}
			connection = null;
		}
	}
1156330
@Override
  public void close() {
    LOG.info("Closing " + this.getClass().getSimpleName());
    try (Connection conn = createConnection()) {
      JdbcWriterCommands commands = createJdbcWriterCommands(conn);
      if (!this.createdStagingTables.isEmpty()) {
        for (String stagingTable : this.createdStagingTables) {
          LOG.info("Dropping staging table " + this.createdStagingTables);
          commands.drop(database, stagingTable);
        }
      }

      if (this.userCreatedStagingTable != null) {
        LOG.info("Truncating staging table " + this.userCreatedStagingTable);
        commands.truncate(database, this.userCreatedStagingTable);
      }
    } catch (SQLException e) {
      throw new RuntimeException("Failed to close", e);
    }
  }
1193674
public void close() {
    synchronized (lock) {
      while (!available.isEmpty()) {
        PooledConnection pci = available.pop();
        try {
          pci.close();
        } catch (SQLException e) {
        }
      }
      available = null;
      while (!used.isEmpty()) {
        PooledConnection pci = used.pop();
        pci.removeConnectionEventListener(connectionEventListener);
        try {
          pci.close();
        } catch (SQLException e) {
        }
      }
      used = null;
    }
    removeStoredDataSource();
  }
296661
public void closePhysically() throws SQLException {

        SQLException exception = null;

        if (!isClosed && this.connection != null
                && !this.connection.isClosed()) {
            try {
                this.connection.close();
            } catch (SQLException e) {

                //catch and hold so that the rest of the finalizer is run too. Throw at the end if present.
                exception = e;
            }
        }
        this.isClosed           = true;
        this.pooledConnection   = null;
        this.connection         = null;
        this.connectionDefaults = null;

        this.connectionListeners.clear();

        this.connectionListeners = null;

        if (exception != null) {
            throw exception;
        }
    }
282515
public void close() throws OdaException
	{
		if (db!=null && !db.isClosed()){
			db.close();
		}
		db = null;
	    m_isOpen = false;
	}
495321
def close(self):
        
        super(LockingDatabase, self).close()
        if not self.readonly:
            self.release_lock()
1092497
public static void release(ResultSet result, Statement statement, Connection connection) {
        if (result != null) {
            try {
                result.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }

        if (statement != null) {
            try {
                statement.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }

        if (connection != null) {
            JDBCUtils.release(connection);
        }
    }
227747
@Override
	public void close() throws IOException {
		try {
			upload.executeBatch();
			batchCount = 0;
			upload.close();
			dbConn.close();
		} catch (SQLException sqe) {
			throw new IllegalArgumentException("close() failed:\t", sqe);
		}
	}
1371303
public static void close(Connection conn) {
        if (conn != null) {
            try {
                conn.close();
            } catch (SQLException ex) {
                logger.error("", ex);
            }
        }
    }
517040
public void close() {
        lock.lock();
        try {
            if (this.closed) {
                return;
            }

            if (!this.inited) {
                return;
            }

            if (logStatsThread != null) {
                logStatsThread.interrupt();
            }

            if (createConnectionThread != null) {
                createConnectionThread.interrupt();
            }

            if (destroyConnectionThread != null) {
                destroyConnectionThread.interrupt();
            }

            if (destroySchedulerFuture != null) {
                destroySchedulerFuture.cancel(true);
            }

            for (int i = 0; i < poolingCount; ++i) {
                try {
                    DruidConnectionHolder connHolder = connections[i];

                    for (PreparedStatementHolder stmtHolder : connHolder.getStatementPool().getMap().values()) {
                        connHolder.getStatementPool().closeRemovedStatement(stmtHolder);
                    }
                    connHolder.getStatementPool().getMap().clear();

                    Connection physicalConnection = connHolder.getConnection();
                    physicalConnection.close();
                    connections[i] = null;
                    destroyCount.incrementAndGet();
                } catch (Exception ex) {
                    LOG.warn("close connection error", ex);
                }
            }
            poolingCount = 0;

            // close elasticsearch client
            if (this.client != null) {
                this.client.close();
            }

            unregisterMbean();

            enable = false;
            notEmpty.signalAll();
            notEmptySignalCount++;

            this.closed = true;
            this.closeTimeMillis = System.currentTimeMillis();

            for (Filter filter : filters) {
                filter.destroy();
            }
        } finally {
            lock.unlock();
        }

        if (LOG.isInfoEnabled()) {
            LOG.info("{dataSource-" + this.getID() + "} closed");
        }
    }