Java SQL ResultSet Close closeResultSet(ResultSet rs)

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

Description

close Result Set

License

Open Source License

Declaration

public static void closeResultSet(ResultSet rs) 

Method Source Code

//package com.java2s;
/**/*ww  w.jav  a2s  . c  om*/
 * (C) 2010-2011 Alibaba Group Holding Limited.
 * <p/>
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * version 2 as published by the Free Software Foundation.
 */

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

public class Main {
    public static void closeResultSet(ResultSet rs) {
        try {
            if (null != rs) {
                Statement stmt = rs.getStatement();
                if (null != stmt) {
                    stmt.close();
                    stmt = null;
                }
                rs.close();
            }
            rs = null;
        } catch (SQLException e) {
            throw new IllegalStateException(e.getCause());
        }
    }
}

Related

  1. closeResources(Connection conn2, Statement statement, ResultSet rs)
  2. closeResultAndStatement(Statement statement, ResultSet resultSet)
  3. closeResultSet(final ResultSet resultSet)
  4. closeResultSet(ResultSet resultSet)
  5. closeResultset(ResultSet resultset)
  6. closeResultSet(ResultSet rs)
  7. closeResultSet(ResultSet rs)
  8. closeResultSet(ResultSet rs)
  9. closeResultSet(ResultSet rs)