Here you can find the source of closeCursor(Statement stmt, ResultSet rows)
public static List<String> closeCursor(Statement stmt, ResultSet rows)
//package com.java2s; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import java.util.List; public class Main { public static List<String> closeCursor(Statement stmt, ResultSet rows) { List<String> exceptions = new ArrayList<String>(); try {//from www.ja v a 2 s.co m if (rows != null) rows.close(); } catch (SQLException e) { // During hard-close it's acceptable to just // log the message. // // Save the message with the intention of logging // it from the caller. exceptions.add(e.getMessage()); } try { if (stmt != null) stmt.close(); } catch (SQLException e) { // During hard-close it's acceptable to just // log the message. // // Save the message with the intention of logging // it from the caller. exceptions.add(e.getMessage()); } return exceptions; } }