Executes a query to the test_db and closes the connection afterwards.
490436
def execute_query(self, query, values):
        
        retval = self.cursor.execute(query, values)
        self.__close_db()
        return retval
185838
def close(self, response):
        """"""
        LOGGER.info('Closing [%s]', os.getpid())
        if not self.database.is_closed():
            self.database.close()
        return response
650434
private void execute(String sql) throws SQLException {
        Statement statement = connection.createStatement();
        try {
            statement.executeUpdate(substitute(sql));
        } finally {
            DbUtils.closeQuietly(statement);
        }
    }
83330
public void close() {

        // result set
        if (m_resultset != null) {
            try {
                m_resultset.close();
            } catch (Exception e) {
                e.printStackTrace();

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

            }
        }
        // prepared statement
        if (m_preparedStatement != null) {
            try {
                m_preparedStatement.close();
            } catch (Exception e) {
                e.printStackTrace();

            }
        }

    }
445225
public void close(boolean closeConnection) throws SQLException {
        if (closeConnection) {
            resultSet.getStatement().getConnection().close();
        } else {
            resultSet.close();
        }

        finished = true;
    }
797674
def ExecuteQuery(self, query, args=None):
    """"""

    def Action(connection):
      connection.cursor.execute(query, args)
      rowcount = connection.cursor.rowcount
      results = connection.cursor.fetchall()
      return results, rowcount

    return self._RetryWrapper(Action)
687948
public void close(boolean arbitrarily) {
        if (checkSession()) {
            return;
        }

        arbitrarilyClosed = arbitrarily;
        sqlSession.close();

        if (log.isDebugEnabled()) {
            log.debug(String.format("Closed %s@%x",
                    sqlSession.getClass().getSimpleName(),
                    sqlSession.hashCode()));
        }

        sqlSession = null;
    }
81287
static void closeQuietly(ResultSet ps)
    {
        if (ps != null)
        {
            try
            {
                ps.getStatement().close();
                // ps.close();
            }
            catch (Exception e)
            {
                // Should go with the connection anyway.
                // jqmlogger.warn("Could not close a DB result set - possible pool leak", e);
            }
        }
    }
1263307
public void close() throws SQLException {
		try {

			if (this.resetConnectionOnClose /*FIXME: && !getAutoCommit() && !isTxResolved() */){
				/*if (this.autoCommitStackTrace != null){
						logger.debug(this.autoCommitStackTrace);
						this.autoCommitStackTrace = null; 
					} else {
						logger.debug(DISABLED_AUTO_COMMIT_WARNING);
					}*/
				rollback();
				if (!getAutoCommit()){
					setAutoCommit(true);
				}
			}

			if (this.logicallyClosed.compareAndSet(false, true)) {


				if (this.threadWatch != null){
					this.threadWatch.interrupt(); // if we returned the connection to the pool, terminate thread watch thread if it's
					// running even if thread is still alive (eg thread has been recycled for use in some
					// container).
					this.threadWatch = null;
				}

				if (this.closeOpenStatements){
					for (Entry<Statement, String> statementEntry: this.trackedStatement.entrySet()){
						statementEntry.getKey().close();
						if (this.detectUnclosedStatements){
							logger.warn(String.format(UNCLOSED_LOG_ERROR_MESSAGE, statementEntry.getValue()));		
						}
					}
					this.trackedStatement.clear();
				} 

				if (!this.connectionTrackingDisabled){
					pool.getFinalizableRefs().remove(this.connection);
				}

				ConnectionHandle handle = null;

				//recreate can throw a SQLException in constructor on recreation
				try {
				    handle = this.recreateConnectionHandle();
				    this.pool.connectionStrategy.cleanupConnection(this, handle);
				    this.pool.releaseConnection(handle);				    
				} catch(SQLException e) {
				    //check if the connection was already closed by the recreation
				    if (!isClosed()) {
				    	this.pool.connectionStrategy.cleanupConnection(this, handle);
				    	this.pool.releaseConnection(this);
				    }
				    throw e;
				}
				
				
				if (this.doubleCloseCheck){
					this.doubleCloseException = this.pool.captureStackTrace(CLOSED_TWICE_EXCEPTION_MESSAGE);
				}
			} else {
				if (this.doubleCloseCheck && this.doubleCloseException != null){
					String currentLocation = this.pool.captureStackTrace("Last closed trace from thread ["+Thread.currentThread().getName()+"]:\n");
					logger.error(String.format(LOG_ERROR_MESSAGE, this.doubleCloseException, currentLocation));
				}
			}
		} catch (SQLException e) {
			throw markPossiblyBroken(e);
		}
	}
4714
public void close() throws QueryException {
        try {
            if(! (socket instanceof SSLSocket))
                socket.shutdownInput();
        } catch (IOException ignored) {
        }
        try {
            final ClosePacket closePacket = new ClosePacket();
            closePacket.send(writer);
            if (! (socket instanceof SSLSocket))
                socket.shutdownOutput();
            writer.close();
            packetFetcher.close();
        } catch (IOException e) {
            throw new QueryException("Could not close connection: " + e.getMessage(),
                    -1,
                    SQLExceptionMapper.SQLStates.CONNECTION_EXCEPTION.getSqlState(),
                    e);
        } finally {
            try {
                this.connected = false;
                socket.close();
            } catch (IOException e) {
                log.warning("Could not close socket");
            }
        }
        this.connected = false;
    }
847233
public void close() {
		try {
			Statement statement = set.getStatement();
			if (statement!=null && !statement.isClosed())
				statement.close();
			// Normally not necessary (according to the JDBC standard)
			if (set!=null && !set.isClosed())
				set.close();
		} catch (SQLException e) {
			// NO-OP
		}
	}
1358982
public void close() throws SQLException
	{
		more = false;
		if(!exclusive)
			return;
		if(rs != null)
		{
			rs.close();
			rs = null;
		}
		if(stmt != null)
		{
			stmt.close();
			stmt = null;
		}
	}
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;
        }
    }
817611
public function close(): void
    {
        if (!sqlsrv_free_stmt($this->stmt)) {
            throw new SqlException('Failed to close statement', sqlsrv_errors(), $this->query, $this->params);
        }
    }
1141793
protected void closeConnection(DatabaseConnection connection) throws SQLException {
		// this can return null if we are closing the pool
		ConnectionMetaData meta = connectionMap.remove(connection);
		IOUtils.closeThrowSqlException(connection, "SQL connection");
		logger.debug("closed connection {}", meta);
		closeCount++;
	}
1326514
def close(self):
        

        self.__decrement_connection_counter()
        if self.connection_count == 0:
            if self.dbfile == ":memory:":
                SQL = """DROP TABLE IF EXISTS __self__"""
                self.sql(SQL, asrecarray=False, cache=False)
            else:
                self.connection.commit()
                self.connection.close()
1003411
@Override
    public void close() {
        namedParamSqlCache.clear();
        namedParamIndexPropCache.clear();
        clearStatementCache();
        if (useConnection != null) {
            try {
                useConnection.close();
            } catch (SQLException e) {
                LOG.finest("Caught exception closing connection: " + e.getMessage());
            }
        }
    }