com.ibm.tivoli.maximo.dbmanage.connection

Class MTSQLException

  • java.lang.Object
    • java.lang.Throwable
      • java.lang.Exception
        • java.sql.SQLException
          • com.ibm.tivoli.maximo.dbmanage.connection.MTSQLException
  • All Implemented Interfaces:
    MaximoSQLException, java.io.Serializable, java.lang.Iterable


    public class MTSQLException
    extends java.sql.SQLException
    implements MaximoSQLException
    When an SQLException is thrown when executing SQL on a MT-enabled database, it is wrapped in this exception class. This exception class may have multiple sub-exceptions, chained together. This object will have the context where the SQLExeception was thrown. Note that the list of exceptions returned from MTSQLException.getExceptionsWithContext() may differ from exceptions returns from the getNextException chain.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      MTSQLException()
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addException(MTContext context, java.sql.SQLException se)
      Add the exception and the context where the exception was thrown.
      java.lang.Throwable getCause() 
      java.lang.String getDefaultMessage()
      Give the default message, for when the message isn't found in the message table.
      int getErrorCode() 
      java.lang.String getErrorGroup()
      Give the error group.
      java.lang.String getErrorKey() 
      java.util.List getExceptionsWithContext()
      Returns the list of exceptions that were caught
      java.lang.String getMessage() 
      java.lang.Object[] getParameters() 
      void removeFromChain(int pos)
      Remove the exception from it's position in the chain.
      int replaceInChain(DoubleKey target, DoubleKey replacement)
      Replace an exception in the chained exceptions.
      java.lang.String toString() 
      • Methods inherited from class java.sql.SQLException

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

        addSuppressed, fillInStackTrace, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
      • 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
    • Constructor Detail

      • MTSQLException

        public MTSQLException()
        Constructor
    • Method Detail

      • addException

        public void addException(MTContext context,
                                 java.sql.SQLException se)
        Add the exception and the context where the exception was thrown.
        Parameters:
        context - The context of the connection where the exception occurred. Landlord, Master, etc...
        se - The thrown exception.
      • getErrorCode

        public int getErrorCode()
        Overrides:
        getErrorCode in class java.sql.SQLException
      • getExceptionsWithContext

        public java.util.List getExceptionsWithContext()
        Returns the list of exceptions that were caught
        Returns:
        a list with at least one context + exception pair
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Throwable
      • getMessage

        public java.lang.String getMessage()
        Overrides:
        getMessage in class java.lang.Throwable
      • getDefaultMessage

        public java.lang.String getDefaultMessage()
        Description copied from interface: MaximoSQLException
        Give the default message, for when the message isn't found in the message table.
        Specified by:
        getDefaultMessage in interface MaximoSQLException
      • getCause

        public java.lang.Throwable getCause()
        Specified by:
        getCause in interface MaximoSQLException
        Overrides:
        getCause in class java.lang.Throwable
      • replaceInChain

        public int replaceInChain(DoubleKey target,
                                  DoubleKey replacement)
        Replace an exception in the chained exceptions. Updates the caught exceptions list. Note that the getNextException chain can't be updated.
        Parameters:
        target - The exception to remove
        replacement - The replacement exception
        Returns:
        The position where the exception was replaced.
      • removeFromChain

        public void removeFromChain(int pos)
        Remove the exception from it's position in the chain. Not that the results of the getNextException chain can't be altered.
        Parameters:
        pos -