Here you can find the source of commitAndClose(Connection conn)
public static void commitAndClose(Connection conn) throws SQLException
//package com.java2s; //License from project: Open Source License import java.sql.*; public class Main { public static void commitAndClose(Connection conn) throws SQLException { if (conn != null) { try { conn.commit();//w w w . j a v a2 s .co m } finally { conn.close(); } } } public static void close(Connection conn) throws SQLException { if (conn != null) { conn.close(); } } public static void close(ResultSet rs) throws SQLException { if (rs != null) { rs.close(); } } public static void close(Statement stmt) throws SQLException { if (stmt != null) { stmt.close(); } } }