release SQL Connection - Java java.sql

Java examples for java.sql:Connection

Description

release SQL Connection

Demo Code


//package com.java2s;
import java.sql.Connection;

public class Main {
    public static void releaseConnection(Connection conn) {
        // presumed fail-safe
        try {//from w w w  . ja v a 2 s  .  c  o m
            if (conn != null) {
                conn.close();
            }
        } catch (Throwable t) {
            t.printStackTrace();
        }
    }
}

Related Tutorials