Class JdbcUtils
java.lang.Object
org.apache.shiro.util.JdbcUtils
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
Modifier and TypeMethodDescriptionstatic voidcloseConnection(Connection connection) Close the given JDBC Connection and ignore any thrown exception.static voidClose the given JDBC ResultSet and ignore any thrown exception.static voidcloseStatement(Statement statement) Close the given JDBC Statement and ignore any thrown exception.
-
Method Details
-
closeConnection
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
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
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)
-