org.apache.shiro.util
Class JdbcUtils

java.lang.Object
  extended by org.apache.shiro.util.JdbcUtils

public class JdbcUtils
extends Object

A set of static helper methods for managing JDBC API objects.

Note: Some parts of this class were copied from the Spring Framework and then modified. They were copied here to prevent Spring dependencies in the Shiro core API. The original license conditions (Apache 2.0) have been maintained.

Since:
0.2

Method Summary
static void closeConnection(Connection connection)
          Close the given JDBC Connection and ignore any thrown exception.
static void closeResultSet(ResultSet rs)
          Close the given JDBC ResultSet and ignore any thrown exception.
static void closeStatement(Statement statement)
          Close the given JDBC Statement and ignore any thrown exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

closeConnection

public static void closeConnection(Connection connection)
Close the given JDBC Connection and ignore any thrown exception. This is useful for typical finally blocks in manual JDBC code.

Parameters:
connection - the JDBC Connection to close (may be null)

closeStatement

public static void closeStatement(Statement statement)
Close the given JDBC Statement and ignore any thrown exception. This is useful for typical finally blocks in manual JDBC code.

Parameters:
statement - the JDBC Statement to close (may be null)

closeResultSet

public static void closeResultSet(ResultSet rs)
Close the given JDBC ResultSet and ignore any thrown exception. This is useful for typical finally blocks in manual JDBC code.

Parameters:
rs - the JDBC ResultSet to close (may be null)


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.