Here you can find the source of close(ResultSet rs, Statement st, Connection conn)
public static void close(ResultSet rs, Statement st, Connection conn)
//package com.java2s; //License from project: Apache License import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class Main { public static void close(ResultSet rs, Statement st, Connection conn) { try {/* ww w . jav a2s. c o m*/ if (rs != null) { rs.close(); } } catch (SQLException e) { e.printStackTrace(); } finally { try { if (st != null) { st.close(); } } catch (SQLException e) { e.printStackTrace(); } finally { if (conn != null) { try { conn.close(); } catch (SQLException e) { e.printStackTrace(); } } } } } }