Class NestedSQLException

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Iterable<java.lang.Throwable>, NestedThrowable

    public class NestedSQLException
    extends java.sql.SQLException
    implements NestedThrowable
    A common superclass for SQLException classes that can contain a nested Throwable detail object.
    Version:
    $Revision$
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      NestedSQLException​(java.lang.String msg)
      Construct a NestedSQLException with the specified detail message.
      NestedSQLException​(java.lang.String msg, java.lang.String state)
      Construct a NestedSQLException.
      NestedSQLException​(java.lang.String msg, java.lang.String state, int code)
      Construct a NestedSQLException.
      NestedSQLException​(java.lang.String msg, java.lang.Throwable nested)
      Construct a NestedSQLException with the specified detail message and nested Throwable.
      NestedSQLException​(java.lang.Throwable nested)
      Construct a NestedSQLException with the specified nested Throwable.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Throwable getCause()
      Return the nested Throwable.
      java.lang.String getMessage()
      Returns the composite throwable message.
      java.lang.Throwable getNested()
      Return the nested Throwable.
      void printStackTrace()
      Prints the composite message and the embedded stack trace to System.err.
      void printStackTrace​(java.io.PrintStream stream)
      Prints the composite message and the embedded stack trace to the specified print stream.
      void printStackTrace​(java.io.PrintWriter writer)
      Prints the composite message and the embedded stack trace to the specified print writer.
      • Methods inherited from class java.sql.SQLException

        getErrorCode, getNextException, getSQLState, iterator, setNextException
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getLocalizedMessage, getStackTrace, getSuppressed, initCause, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        The serialVersionUID
        See Also:
        Constant Field Values
      • nested

        protected final java.lang.Throwable nested
        The nested throwable
    • Constructor Detail

      • NestedSQLException

        public NestedSQLException​(java.lang.String msg)
        Construct a NestedSQLException with the specified detail message.
        Parameters:
        msg - Detail message.
      • NestedSQLException

        public NestedSQLException​(java.lang.String msg,
                                  java.lang.Throwable nested)
        Construct a NestedSQLException with the specified detail message and nested Throwable.
        Parameters:
        msg - Detail message.
        nested - Nested Throwable.
      • NestedSQLException

        public NestedSQLException​(java.lang.Throwable nested)
        Construct a NestedSQLException with the specified nested Throwable.
        Parameters:
        nested - Nested Throwable.
      • NestedSQLException

        public NestedSQLException​(java.lang.String msg,
                                  java.lang.String state)
        Construct a NestedSQLException.
        Parameters:
        msg - Detail message.
        state - SQL state message.
      • NestedSQLException

        public NestedSQLException​(java.lang.String msg,
                                  java.lang.String state,
                                  int code)
        Construct a NestedSQLException.
        Parameters:
        msg - Detail message.
        state - SQL state message.
        code - SQL vendor code.
    • Method Detail

      • getNested

        public java.lang.Throwable getNested()
        Return the nested Throwable.
        Specified by:
        getNested in interface NestedThrowable
        Returns:
        Nested Throwable.
      • getCause

        public java.lang.Throwable getCause()
        Return the nested Throwable.

        For JDK 1.4 compatibility.

        Specified by:
        getCause in interface NestedThrowable
        Overrides:
        getCause in class java.lang.Throwable
        Returns:
        Nested Throwable.
      • getMessage

        public java.lang.String getMessage()
        Returns the composite throwable message.
        Overrides:
        getMessage in class java.lang.Throwable
        Returns:
        The composite throwable message.
      • printStackTrace

        public void printStackTrace​(java.io.PrintStream stream)
        Prints the composite message and the embedded stack trace to the specified print stream.
        Overrides:
        printStackTrace in class java.lang.Throwable
        Parameters:
        stream - Stream to print to.
      • printStackTrace

        public void printStackTrace​(java.io.PrintWriter writer)
        Prints the composite message and the embedded stack trace to the specified print writer.
        Overrides:
        printStackTrace in class java.lang.Throwable
        Parameters:
        writer - Writer to print to.
      • printStackTrace

        public void printStackTrace()
        Prints the composite message and the embedded stack trace to System.err.
        Overrides:
        printStackTrace in class java.lang.Throwable