Close a Statement

@param st a database Statement object
338242
public static void closeStatement(final Statement st) {
        if (st == null) {
            return;
        }

        try {
            st.close();
        } catch (Exception e) {
            if (LOG.isWarnEnabled()) LOG.warn("Error closing Statement: " + st, e);
        }
    }
1054953
public void close()
    {
        super.close();  // Do any inherited
        try   {
            if (m_remoteDatabase != null)
            {
                synchronized (this.getSyncObject(m_remoteDatabase))
                {   // In case this is called from another task
                    m_remoteDatabase.close();
                }
            }
        } catch (RemoteException ex)    {
            Utility.getLogger().warning("Remote close error: " + ex.getMessage());
            ex.printStackTrace();
        }
    }
673248
public static void closeResultSet(ResultSet rs){
		if (rs != null) {
			try {
				rs.close();
			} catch (Exception e) {
				log.warn("Exception when closing database result set.", e);
			}
		}
	}
127139
@Override
	public void close() throws IOException {
		if (resultSet == null) {
			return;
		}
		try {
			resultSet.close();
		} catch (SQLException se) {
			LOG.info("Inputformat ResultSet couldn't be closed - " + se.getMessage());
		}
	}
963160
public synchronized void close() {
        if (mIsInitializing) throw new IllegalStateException("Closed during initialization");

        if (mDatabase != null && mDatabase.isOpen()) {
            mDatabase.close();
            mDatabase = null;
        }
    }
1032852
private void closeResultSet(ResultSet rs) {
    if (rs != null) {
      try {
        rs.close();
      } catch (SQLException e) {
        logger.error("Could not close JDBC ResultSet", e);
      } catch (Throwable e) {
        logger.error("Unexpected exception on closing JDBC ResultSet", e);
      }
    }
  }
1165819
public static void release(Statement statement, Connection connection) {

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

        if (connection != null) {
            JDBCUtils.release(connection);
        }
    }
174827
private void cleanConnectionClose(Connection connection, Statement stmt) {
        try {
            // clean close
            if (connection != null) {
                connection.rollback();
            }

            if (stmt != null) {
                stmt.close();
            }

            if (connection != null) {
                connection.close();
            }
        } catch (SQLException e1) {
            e1.printStackTrace();
        }
    }
710
public static void closeResultSet(final ResultSet rs) {
        if (rs == null) {
            return;
        }

        try {
            rs.close();
        } catch (Exception e) {
            if (LOG.isWarnEnabled()) LOG.warn("Error closing ResultSet: " + rs, e);
        }
    }
738374
@Override
	public void close() {
		transactionManager.close();
		if (coverageHandlerRef.get() != null) {
			coverageHandlerRef.get().onSqlAgentClose();
		}
	}
1002114
private void pruneStatement(final Statement stmt, final Document doc) {
        final List<StatementGroup> stmtgroups = doc.getAllStatementGroups();
        for (final StatementGroup stmtgroup : stmtgroups) {
            final Iterator<Statement> sgi = stmtgroup.getStatements()
                    .iterator();
            while (sgi.hasNext()) {
                final Statement sgs = sgi.next();
                if (stmt.equals(sgs)) {
                    // prune
                    sgi.remove();
                    return;
                }
            }
        }
    }
583419
public static void closeStatement(Statement statement)
        throws InternalErrorException {

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

    }
1269867
public static void closeQuietly(Connection conn, Statement stmt,
            ResultSet rs) {

        try {
            closeQuietly(rs);
        } finally {
            try {
                closeQuietly(stmt);
            } finally {
                closeQuietly(conn);
            }
        }

    }
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);
        }
    }
462805
public function closeCursor()
    {
        $this->_statement->closeCursor();
        $this->_closed = true;
        $this->_index = null;
    }
639544
private void closeQuietly() {
        log.debug("closing rs");
        Util.closeQuietly(rs);
        log.debug("closing ps");
        Util.closeQuietly(ps);
        log.debug("closing con");
        Util.closeQuietlyIfAutoCommit(con);
        log.debug("closed");
    }
677297
private boolean closeStatements() {

      // JDBC API says...
      // Calling the method close on a Statement object that is already closed has no effect.
      // Note: When a Statement object is closed, its current ResultSet object, if one exists, is also closed.

      boolean hasUnclosed = false;

      if(openStatements.size() > 0) {
         for(Statement stmt : openStatements) {
            try {
               if(!stmt.isClosed()) {
                  stmt.close();
                  hasUnclosed = true;
               }
            } catch(SQLException e) {
               hasUnclosed = true;
               setLogicalCloseException(e);
            } catch(Throwable t) {
               hasUnclosed = true;
               if(logicalCloseException == null) {
                  if(Util.isRuntimeError(t)) {
                     setLogicalCloseException(t);
                  } else {
                     setLogicalCloseException(new SQLException(t));
                  }
               }
            }
         }

         openStatements.clear();
      }

      return hasUnclosed;
   }