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)
close
try {
    if (rs != null) {
        rs.close();
} catch (Exception e) {
voidclose(ResultSet rs)
Close a ResultSet, avoid closing if null.
if (rs != null) {
    rs.close();
voidclose(ResultSet rs, PreparedStatement pstmt, Connection con)
close
try {
    if (rs != null)
        rs.close();
    if (pstmt != null)
        pstmt.close();
    if (con != null)
        con.close();
} catch (Throwable e) {
...
voidclose(ResultSet rs, Statement ps, Connection con)
close
close(rs);
close(ps);
close(con);
voidclose(ResultSet rs, Statement ps, Connection conn)
close
try {
    if (rs != null) {
        rs.close();
} catch (SQLException e) {
    e.printStackTrace();
try {
...
voidclose(ResultSet rs, Statement st, Connection con)
Close connection
try {
    try {
        if (rs != null) {
            rs.close();
    } finally {
        try {
            if (st != null) {
...
voidclose(ResultSet rs, Statement st, Connection conn)
close
try {
    if (rs != null) {
        rs.close();
} catch (SQLException e) {
    e.printStackTrace();
} finally {
    try {
...
voidclose(ResultSet rs, Statement stmt)
close
closeResultSet(rs);
closeStatement(stmt);
voidclose(ResultSet rs, Statement stmt, Connection con)
Utility function for safely closing open resultset/statement/connection
if (rs != null) {
    try {
        rs.close();
    } catch (SQLException e) {
        System.out.println("The result set cannot be closed.");
if (stmt != null) {
...
voidclose(ResultSet rs, Statement stmt, Connection con)
Closes a result set, statement, and connection.
close(rs);
close(stmt);
close(con);