Here you can find the source of closeResultSet(ResultSet rs)
public static void closeResultSet(ResultSet rs)
//package com.java2s; /******************************************************************************* * Copyright (c) 2014 Cai Bowen, Zhou Liangpeng. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser Public License v2.1 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * //from w w w .j a va 2 s. c o m * Contributors: * Cai Bowen, Zhou Liangpeng. - initial API and implementation ******************************************************************************/ import java.sql.ResultSet; import java.sql.SQLException; public class Main { public static void closeResultSet(ResultSet rs) { if (rs != null) { try { rs.close(); } catch (SQLException e) { throw new RuntimeException(e.getSQLState() + "\nCaused by\n" + e.getCause(), e); } } } }