Here you can find the source of close(Connection con)
public static void close(Connection con)
//package com.java2s; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; public class Main { public static void close(Connection con) { try {// w ww . j a v a2 s. c o m if (con != null) con.close(); } catch (SQLException e) { e.printStackTrace(); } } public static void close(PreparedStatement ps) { try { if (ps != null) ps.close(); } catch (SQLException e) { e.printStackTrace(); } } public static void close(ResultSet rs) { try { if (rs != null) rs.close(); } catch (SQLException e) { e.printStackTrace(); } } }