Class ExceptionFactory

  • Direct Known Subclasses:
    SQLExceptionFactory

    public abstract class ExceptionFactory
    extends java.lang.Object
    An exception factory is used to create SQLExceptions of the correct type.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static ExceptionFactory INSTANCE
      The singleton ExceptionFactory instance.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      static ExceptionFactory getInstance()
      Get the singleton exception factory instance.
      abstract java.sql.SQLException getSQLException​(java.lang.String message, java.lang.String messageId, java.sql.SQLException next, int severity, java.lang.Throwable cause, java.lang.Object... args)
      Construct an SQLException whose message and severity are specified explicitly.
      abstract java.sql.SQLException getSQLException​(java.lang.String messageId, java.sql.SQLException next, java.lang.Throwable cause, java.lang.Object... args)
      Construct an SQLException whose message and severity are derived from the message id.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • INSTANCE

        private static final ExceptionFactory INSTANCE
        The singleton ExceptionFactory instance.
    • Constructor Detail

      • ExceptionFactory

        public ExceptionFactory()
    • Method Detail

      • getInstance

        public static ExceptionFactory getInstance()
        Get the singleton exception factory instance.
        Returns:
        an ExceptionFactory instance
      • getSQLException

        public abstract java.sql.SQLException getSQLException​(java.lang.String message,
                                                              java.lang.String messageId,
                                                              java.sql.SQLException next,
                                                              int severity,
                                                              java.lang.Throwable cause,
                                                              java.lang.Object... args)
        Construct an SQLException whose message and severity are specified explicitly.
        Parameters:
        message - the exception message
        messageId - the message id
        next - the next SQLException
        severity - the severity of the exception
        cause - the cause of the exception
        args - the message arguments
        Returns:
        an SQLException
      • getSQLException

        public abstract java.sql.SQLException getSQLException​(java.lang.String messageId,
                                                              java.sql.SQLException next,
                                                              java.lang.Throwable cause,
                                                              java.lang.Object... args)
        Construct an SQLException whose message and severity are derived from the message id.
        Parameters:
        messageId - the message id
        next - the next SQLException
        cause - the cause of the exception
        args - the message arguments
        Returns:
        an SQLException