net.anotheria.db.util
Class JDBCUtil

java.lang.Object
  extended by net.anotheria.db.util.JDBCUtil

public final class JDBCUtil
extends Object

Utility class for closing JDBC resources.

Author:
Alexandr Bolbat

Method Summary
static void close(Connection conn)
          Close Connection if it opened.
static void close(ResultSet rs)
          Close ResultSet if it opened.
static void close(Statement st)
          Close Statement if it opened.
static void release(Connection conn)
          Close Connection if it opened.
static void release(ResultSet rs)
          Close ResultSet if it opened.
static void release(Statement st)
          Close Statement if it opened.
static void rollback(Connection conn)
          Roll back executed queries from last commit for given connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

close

public static void close(Connection conn)
Close Connection if it opened. If SQLException happen on closing it will be logged.

Parameters:
conn - - Connection object

close

public static void close(Statement st)
Close Statement if it opened. If SQLException happen on closing it will be logged.

Parameters:
st - - Statement object

close

public static void close(ResultSet rs)
Close ResultSet if it opened. If SQLException happen on closing it will be logged.

Parameters:
st - - ResultSet object

release

public static void release(Connection conn)
Close Connection if it opened. If SQLException happen on closing it will be logged.

Parameters:
conn - - Connection object

release

public static void release(Statement st)
Close Statement if it opened. If SQLException happen on closing it will be logged.

Parameters:
st - - Statement object

release

public static void release(ResultSet rs)
Close ResultSet if it opened. If SQLException happen on closing it will be logged.

Parameters:
st - - ResultSet object

rollback

public static void rollback(Connection conn)
Roll back executed queries from last commit for given connection. If SQLException happen on closing it will be logged.

Parameters:
conn - - Connection


Copyright © 2010-2013 anotheria.net. All Rights Reserved.