Java SQL ResultSet Close close(final ResultSet rs, final Statement st)

Here you can find the source of close(final ResultSet rs, final Statement st)

Description

close

License

Open Source License

Declaration

public static void close(final ResultSet rs, final Statement st) 

Method Source Code

//package com.java2s;
/**/*w ww  .j av a  2  s  .  c  o  m*/
 * JDBCPersistence framework for java
 *   Copyright (C) 2004-2014 Alex Rojkov
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License as published by the Free Software Foundation; either
 *    version 2.1 of the License, or (at your option) any later version.
 *
 *    This library 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
 *    Lesser General Public License for more details.
 *
 *    You should have received a copy of the GNU Lesser General Public
 *    License along with this library; if not, write to the Free Software
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 *    You can contact me by email jdbcpersistence   a t   gmail    d o t    com
 * */

import java.sql.*;

public class Main {
    public static void close(final ResultSet rs, final Statement st) {
        /*
            System.out.println("SQLUtils.close----------------------------");
            new Exception().printStackTrace();
        */

        if (rs != null) {
            try {
                rs.close();
            } catch (Throwable e) {
                e.printStackTrace();
            }
        }
        if (st != null) {
            try {
                st.close();
            } catch (Throwable e) {
                e.printStackTrace();
            }
        }
    }
}

Related

  1. close(Connection conn, Statement st, ResultSet rs)
  2. close(Connection conn, Statement st, ResultSet rs)
  3. close(Connection connection, PreparedStatement statement, ResultSet resultSet)
  4. close(Connection connection, Statement statement, ResultSet resultSet)
  5. close(final PreparedStatement ps, final ResultSet rs)
  6. close(ResultSet _rsData, Logger _logger)
  7. close(ResultSet resultSet)
  8. close(ResultSet resultSet)
  9. close(ResultSet resultSet)