Java SQL ResultSet Close close(Connection conn, Statement st, ResultSet rs)

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

Description

close

License

Open Source License

Declaration

private static void close(Connection conn, Statement st, ResultSet rs) 

Method Source Code


//package com.java2s;
import java.sql.Connection;

import java.sql.ResultSet;

import java.sql.Statement;

public class Main {
    private static void close(Connection conn, Statement st, ResultSet rs) {
        try {//from  w ww . ja va2s .  c  om
            if (rs != null) {
                rs.close();
            }
            if (st != null) {
                st.close();
            }
            if (conn != null) {
                conn.close();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

Related

  1. close(Connection c, Statement s, ResultSet r)
  2. close(Connection con, Statement stmt, ResultSet rs)
  3. close(Connection conn, PreparedStatement ps, ResultSet rs)
  4. close(Connection conn, Statement st, ResultSet rs)
  5. close(Connection connection, PreparedStatement statement, ResultSet resultSet)
  6. close(Connection connection, Statement statement, ResultSet resultSet)
  7. close(final PreparedStatement ps, final ResultSet rs)