Java SQL ResultSet Close closeResultSetAndStatement(ResultSet rs)

Here you can find the source of closeResultSetAndStatement(ResultSet rs)

Description

close Result Set And Statement

License

Apache License

Declaration

public static void closeResultSetAndStatement(ResultSet rs) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class Main {
    public static void closeResultSetAndStatement(ResultSet rs) {
        closeResultSet(rs);//from   ww  w .  j av a  2  s  .c om
        try {
            closeStatement(rs.getStatement());
        } catch (SQLException e) {

        }
    }

    public static void closeResultSet(ResultSet rs) {
        try {
            rs.close();
        } catch (SQLException e) {

        }
    }

    public static void closeStatement(Statement stmt) {
        if (stmt != null) {
            try {
                stmt.close();
            } catch (SQLException e) {

            }
        }
    }
}

Related

  1. closeResultSet(ResultSet rs)
  2. closeResultSet(ResultSet rs)
  3. closeResultSet(ResultSet rs)
  4. closeResultSet(ResultSet rs)
  5. closeResultSet(ResultSet rs)
  6. closeResultSetAndStatement(Statement statement, ResultSet resultSet)
  7. closeResultSets(List results)
  8. closeResultSets(List resultSets)
  9. closeRS(final ResultSet rs)