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(Connection c, Statement s, ResultSet r)
close
try {
    if (r != null)
        r.close();
} catch (Exception e) {
    e.printStackTrace();
try {
    if (s != null)
...
voidclose(Connection con, Statement stmt, ResultSet rs)
close
if (rs != null) {
    try {
        rs.close();
    } catch (SQLException e) {
        System.out.println("5--SQLException");
        e.printStackTrace();
if (stmt != null) {
    try {
        stmt.close();
    } catch (SQLException e) {
        System.out.println("6-SQLException");
        e.printStackTrace();
if (con != null) {
    try {
        con.close();
    } catch (SQLException e) {
        System.out.println("7-closeSQLException");
        e.printStackTrace();
voidclose(Connection conn, PreparedStatement ps, ResultSet rs)
close
if (rs != null) {
    try {
        rs.close();
    } catch (SQLException e) {
        e.printStackTrace();
if (ps != null) {
...
voidclose(Connection conn, Statement st, ResultSet rs)
close
try {
    if (rs != null)
        rs.close();
    else if (st != null)
        st.close();
    else if (conn != null)
        conn.close();
} catch (SQLException e) {
...
voidclose(Connection conn, Statement st, ResultSet rs)
close
try {
    if (rs != null) {
        rs.close();
    if (st != null) {
        st.close();
    if (conn != null) {
...
voidclose(Connection connection, PreparedStatement statement, ResultSet resultSet)
close dataSource
if (null != resultSet) {
    try {
        resultSet.close();
    } catch (SQLException e) {
        System.err.println("close resultset error!");
if (null != statement) {
...
voidclose(Connection connection, Statement statement, ResultSet resultSet)
close
if (resultSet != null) {
    resultSet.close();
if (statement != null) {
    statement.close();
if (connection != null) {
    connection.close();
...
voidclose(final PreparedStatement ps, final ResultSet rs)
close
closePS(ps);
closeRS(rs);
voidclose(final ResultSet rs, final Statement st)
close
if (rs != null) {
    try {
        rs.close();
    } catch (Throwable e) {
        e.printStackTrace();
if (st != null) {
...
voidclose(ResultSet _rsData, Logger _logger)
Closes a result set
if (_rsData == null)
    return;
try {
    _rsData.close();
} catch (Exception ex) {
    if (_logger == null) {
        ex.printStackTrace(System.err);
    } else {
...