Here you can find the source of closeResultSets(List
Parameter | Description |
---|---|
results | The ResultSets |
public static void closeResultSets(List<ResultSet> results)
//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)); } }