planetj.dataengine.exception
Class DESQLException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--planetj.exception.CMException
                    |
                    +--planetj.dataengine.exception.DataEngineException
                          |
                          +--planetj.dataengine.exception.DESQLException
All Implemented Interfaces:
Serializable

public class DESQLException
extends DataEngineException

This exception class is used to wrapper SQLExceptions.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class planetj.exception.CMException
DISPLAY_ALL, DISPLAY_CLASS_INFO, DISPLAY_DETAILED_MESSAGE, DISPLAY_MESSAGE, DISPLAY_ORIGINAL_EXCEPTION, FATAL, INFO, SHOW_EXCEPTION, WARNING
 
Constructor Summary
DESQLException(SQLException sqle)
          Creates and initializes a DESQLException object.
DESQLException(SQLException sqle, String sql)
          Creates and initializes a DESQLException object.
 
Method Summary
 int getErrorCode()
          Gets the vendor specific error code of the SQLException contained within this DESQLException object.
 String getSQL()
          Gets the original SQL String run that threw a SQLException.
 SQLException getSQLException()
          Gets the SQLException wrapped inside this DESQLException.
 String getSQLState()
          Gets the SQLState of the SQLException contained within this DESQLException object.
 String getSQLStateClassCode()
          Gets the SQLState's class code from the SQLException wrapped inside this DESQLException.
 void setSQL(String sql)
          Sets the original SQL String run that threw a SQLException.
 String toString()
          Gets this DESQLException as a String.
 
Methods inherited from class planetj.exception.CMException
addPropertyChangeListener, firePropertyChange, getCMMessage, getDetailedMessage, getDisplayString, getDisplayType, getMessage, getNextException, getOriginalException, getType, removePropertyChangeListener, setDetailedMessage, setDisplayType, setMessage, setNextException, setOriginalException, setType
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DESQLException

public DESQLException(SQLException sqle)
Creates and initializes a DESQLException object.

Parameters:
sqle - SQLException

DESQLException

public DESQLException(SQLException sqle,
                      String sql)
Creates and initializes a DESQLException object.

Parameters:
sqle - SQLException from running a SQL String
sql - SQL String run that threw the given SQLException
Method Detail

getErrorCode

public int getErrorCode()
Gets the vendor specific error code of the SQLException contained within this DESQLException object.

Returns:
vendor error code of the SQLException

getSQL

public String getSQL()
Gets the original SQL String run that threw a SQLException.

Returns:
original SQL String run that threw a SQLException

getSQLException

public SQLException getSQLException()
Gets the SQLException wrapped inside this DESQLException.

Returns:
SQLException contained within this object.

getSQLState

public String getSQLState()
Gets the SQLState of the SQLException contained within this DESQLException object.

Returns:
SQLState code of the SQLException

getSQLStateClassCode

public String getSQLStateClassCode()
Gets the SQLState's class code from the SQLException wrapped inside this DESQLException. The SQLState's class code is the first two characters in the String. e.g. if the SQLState is "23000", then the class code would be "23".

Returns:
SQLState's class code of the SQLException

setSQL

public void setSQL(String sql)
Sets the original SQL String run that threw a SQLException.

Parameters:
sql - original SQL String run that threw a SQLException

toString

public String toString()
Gets this DESQLException as a String. Included in the String will be the exception's message, detailed message, SQL String run when the wrapped SQLException was thrown, and original exception.

Overrides:
toString in class CMException
Returns:
String