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;
/*******************************************************************************
 * 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);
            }
        }
    }
}

Related

  1. closeResultSet(final ResultSet resultSet)
  2. closeResultSet(ResultSet resultSet)
  3. closeResultset(ResultSet resultset)
  4. closeResultSet(ResultSet rs)
  5. closeResultSet(ResultSet rs)
  6. closeResultSet(ResultSet rs)
  7. closeResultSet(ResultSet rs)
  8. closeResultSet(ResultSet rs)
  9. closeResultSet(ResultSet rs)