Class DbUtility


  • public final class DbUtility
    extends java.lang.Object
    This class contains some database utility methods.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void close​(java.sql.Connection con, java.sql.Statement stmt, java.sql.ResultSet rs)
      This is a utility method which closes the given resources without throwing exceptions.
      static void close​(java.sql.ResultSet rs)
      This is a utility method which closes the given resources without throwing exceptions.
      static void logException​(java.lang.String message, java.sql.SQLException e)
      Logs an SQL exception on error level, and debug level (more detail).
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • close

        public static void close​(java.sql.ResultSet rs)
        This is a utility method which closes the given resources without throwing exceptions. Any exceptions encountered are logged instead.
        Parameters:
        rs - the ResultSet to close, may be null
      • close

        public static void close​(java.sql.Connection con,
                                 java.sql.Statement stmt,
                                 java.sql.ResultSet rs)
        This is a utility method which closes the given resources without throwing exceptions. Any exceptions encountered are logged instead.
        Parameters:
        con - the Connection to close, may be null
        stmt - the Statement to close, may be null
        rs - the ResultSet to close, may be null
      • logException

        public static void logException​(java.lang.String message,
                                        java.sql.SQLException e)
        Logs an SQL exception on error level, and debug level (more detail).
        Parameters:
        message - the message
        e - the exception