Class JdbcUtils


  • public class JdbcUtils
    extends 
    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

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void  connection)
      Close the given JDBC Connection and ignore any thrown exception.
      static void  rs)
      Close the given JDBC ResultSet and ignore any thrown exception.
      static void  statement)
      Close the given JDBC Statement and ignore any thrown exception.
      • Methods inherited from class java.lang.

        , , , , , , , , , ,
    • Method Detail

      • closeConnection

        public static void closeConnection​( 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)
        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​( 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)