Java SQL ResultSet Close closeResultSets(List results)

Here you can find the source of closeResultSets(List results)

Description

Close a set of java.sql.ResultSet objects, ignoring any errors

License

Open Source License

Parameter

Parameter Description
results The ResultSets

Declaration

public static void closeResultSets(List<ResultSet> results) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

import java.util.Arrays;

import java.util.List;

public class Main {
    /**/*  w w  w.jav a2s.c o m*/
     * Close a set of {@link java.sql.ResultSet} objects, ignoring any errors
     * @param results The ResultSets
     */
    public static void closeResultSets(List<ResultSet> results) {
        for (ResultSet result : results) {
            if (null != result) {
                try {
                    result.close();
                } catch (SQLException e) {
                    // Do nothing
                }
            }
        }
    }

    /**
     * Close a set of {@link java.sql.ResultSet} objects, ignoring any errors
     * @param results The ResultSets
     */
    public static void closeResultSets(ResultSet... results) {
        closeResultSets(Arrays.asList(results));
    }
}

Related

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