Java Utililty Methods SQL ResultSet Close

List of utility methods to do SQL ResultSet Close

Description

The list of methods to do SQL ResultSet Close are organized into topic(s).

Method

voidclose(ResultSet rs, Statement stmt, Connection con)
close
close(rs);
close(stmt);
close(con);
voidclose(Statement statement, ResultSet resultSet)
Closes statements and result sets.
if (resultSet != null) {
    try {
        resultSet.close();
    } catch (SQLException e) {
if (statement != null) {
    try {
...
voidcloseAll(Connection con, PreparedStatement ps, ResultSet rs)
Frees Database Connection.
try {
    if (con != null) {
        closeConnection(con);
} catch (SQLException e) {
    e.printStackTrace();
if (rs != null) {
...
voidcloseAll(Connection conn, Statement stmt, ResultSet rs)

Description:TODO

if (null != rs) {
    try {
        rs.close();
    } catch (SQLException e) {
        e.printStackTrace();
    } finally {
        rs = null;
if (null != stmt) {
    try {
        stmt.close();
    } catch (SQLException e) {
        e.printStackTrace();
    } finally {
        stmt = null;
if (null != conn) {
    try {
        conn.close();
    } catch (SQLException e) {
        e.printStackTrace();
    } finally {
        conn = null;
voidcloseAll(Connection conn, Statement stmt, ResultSet rs)
close All
close(rs);
closeAll(conn, stmt);
voidcloseAll(ResultSet rs)
close All
Statement stmt = null;
Connection conn = null;
try {
    stmt = rs.getStatement();
    conn = stmt.getConnection();
} catch (SQLException e) {
} finally {
    closeResultSet(rs);
...
voidcloseAll(ResultSet rs, Statement st, Connection conn)
Convenience method for closing sql objects.
try {
    if (rs != null) {
        rs.close();
} finally {
    try {
        if (st != null) {
            st.close();
...
voidcloseAll(ResultSet rs, Statement stmt, Connection conn)
close All
close(rs);
close(stmt);
close(conn);
voidcloseAll(ResultSet rs1, Statement stmt1)
close All
if (rs1 != null) {
    rs1.close();
if (stmt1 != null) {
    stmt1.close();
voidcloseAll(ResultSet rset, Statement stmt, Connection conn)
Close a resultset, statement, and connection returning pooled objects to their respective pools.
close(rset);
close(stmt);
close(conn);