net.sf.jso.sql
Class SQLUtil

java.lang.Object
  extended bynet.sf.jso.sql.SQLUtil

public abstract class SQLUtil
extends java.lang.Object

SQL utility class.


Constructor Summary
SQLUtil()
           
 
Method Summary
static void safellyClose(java.sql.Connection c)
          Closes a connection without throwing any exceptions.
static void safellyClose(ConnectionPool pool)
          Closes a connection pool without throwing any exceptions.
static void safellyClose(java.sql.PreparedStatement ps)
          Closes a prepared statement without throwing any exceptions.
static void safellyClose(java.sql.ResultSet rs)
          Closes a result set without throwing any exceptions.
static void safellyCommit(JDBCTransaction tx)
          Commits a transaction without throwing any exceptions.
static void safellyReturn(ConnectionPool pool, java.sql.Connection c)
          Returns a connection to a connection pool without throwing any exceptions.
static void safellyRollback(JDBCTransaction tx)
          Rolls back a transaction without throwing any exceptions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLUtil

public SQLUtil()
Method Detail

safellyClose

public static void safellyClose(java.sql.ResultSet rs)
Closes a result set without throwing any exceptions.

Parameters:
rs - The result set to be closed.

safellyClose

public static void safellyClose(java.sql.PreparedStatement ps)
Closes a prepared statement without throwing any exceptions.

Parameters:
ps - The prepared statement to be closed.

safellyClose

public static void safellyClose(java.sql.Connection c)
Closes a connection without throwing any exceptions.

Parameters:
c - The connection to be closed.

safellyReturn

public static void safellyReturn(ConnectionPool pool,
                                 java.sql.Connection c)
Returns a connection to a connection pool without throwing any exceptions.

Parameters:
pool - The pool from which the connection was borrowed.
c - The connection to be returned.

safellyClose

public static void safellyClose(ConnectionPool pool)
Closes a connection pool without throwing any exceptions.

Parameters:
pool - The connection pool to be closed.

safellyCommit

public static void safellyCommit(JDBCTransaction tx)
Commits a transaction without throwing any exceptions.

Parameters:
tx - The transaction to be commited.

safellyRollback

public static void safellyRollback(JDBCTransaction tx)
Rolls back a transaction without throwing any exceptions.

Parameters:
tx - The transaction to be rolled back.