Here you can find the source of commit(Connection conn)
public static boolean commit(Connection conn)
//package com.java2s; //License from project: Open Source License import java.sql.Connection; import java.sql.PreparedStatement; public class Main { /**/* w w w. j a v a 2s. com*/ * Commit a transaction associated with the specified * statement */ public static boolean commit(PreparedStatement stmt) { try { return commit(stmt.getConnection()); } catch (Throwable t) { } return false; } /** * Commit all transactions associated with the specified * connection */ public static boolean commit(Connection conn) { try { if (!conn.getAutoCommit()) { conn.commit(); return true; } } catch (Throwable t) { } return false; } }