Java SQL ResultSet Close close(ResultSet rs, PreparedStatement pstmt, Connection con)

Here you can find the source of close(ResultSet rs, PreparedStatement pstmt, Connection con)

Description

close

License

Apache License

Declaration

public static void close(ResultSet rs, PreparedStatement pstmt, Connection con) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

public class Main {

    public static void close(ResultSet rs, PreparedStatement pstmt, Connection con) {
        try {/*from  www. j  av a2  s.  com*/
            if (rs != null)
                rs.close();
            if (pstmt != null)
                pstmt.close();
            if (con != null)
                con.close();
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }
}

Related

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