Java SQL ResultSet Close close(Statement statement, ResultSet resultSet)

Here you can find the source of close(Statement statement, ResultSet resultSet)

Description

Closes statements and result sets.

License

Open Source License

Declaration

@Deprecated
public static void close(Statement statement, ResultSet resultSet) 

Method Source Code

//package com.java2s;
/*/* w w w  . j a v a 2  s  .c om*/
 * RHQ Management Platform
 * Copyright (C) 2005-2013 Red Hat, Inc.
 * All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation version 2 of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
 */

import java.sql.ResultSet;

import java.sql.SQLException;
import java.sql.Statement;

public class Main {
    /**
     * Closes statements and result sets.
     */
    @Deprecated
    public static void close(Statement statement, ResultSet resultSet) {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
        }

        if (statement != null) {
            try {
                statement.close();
            } catch (SQLException e) {
            }
        }
    }
}

Related

  1. close(ResultSet rs, Statement st, Connection conn)
  2. close(ResultSet rs, Statement stmt)
  3. close(ResultSet rs, Statement stmt, Connection con)
  4. close(ResultSet rs, Statement stmt, Connection con)
  5. close(ResultSet rs, Statement stmt, Connection con)
  6. closeAll(Connection con, PreparedStatement ps, ResultSet rs)
  7. closeAll(Connection conn, Statement stmt, ResultSet rs)
  8. closeAll(Connection conn, Statement stmt, ResultSet rs)
  9. closeAll(ResultSet rs)