com.pega.pegarules.pub.database
Class DatabaseException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.pega.pegarules.pub.PRException
              extended by com.pega.pegarules.pub.database.DatabaseException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
BadClassDefinitionException, BadInputException, BadInstanceDataException, BadRoleException, BadRulesetException, BadTableMappingException, CacheException, ConfigurationException, ConnectionException, InitializationException, IntegrityConstraintViolationException, JTAException, LockFailureException, MultipleCircumstancePropertiesException, MultipleInstancesWithKeyException, MultipleRuleVersionException, NoRuleVersionWithoutCircumstanceException

public class DatabaseException
extends PRException

An exception in database processing. Many methods in this package throw a subclass of this exception to indicate an error.

The subclass ConnectionException (and its subclasses) represent connection errors, and the other subclasses represent operational errors.

In most cases, when an exception is thrown, the Processing Status is set to Error. Following are some subclasses of DatabaseException that are commonly used, and the messages typically used for the Processing Status error.

See the subclasses of this class for more information about specific exception classes.

Version:
$Revision: 21233 $ $Date: 2012-02-23 17:04:03 -0500 (Thu, 23 Feb 2012) $
Author:
Jamie Gentry
See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
           
static java.lang.String VERSION
           
 
Constructor Summary
DatabaseException(int aSeverity, java.lang.String aDescr)
          Creates an exception with a severity and a message.
DatabaseException(java.lang.String aDescr)
          Creates a database exception with a given message.
DatabaseException(java.lang.Throwable aCause, int aSeverity, java.lang.String aDescr, java.lang.String aSQL, java.lang.String[] aSQLInserts)
          Creates a general database exception with a given severity, and with other information.
DatabaseException(java.lang.Throwable aCause, java.lang.String aDescr)
          Creates a database exception with a given message, caused by the given exception or error.
DatabaseException(java.lang.Throwable aCause, java.lang.String aMsgID, java.lang.String[] aMsgInserts, int aSeverity, java.lang.String aSQL, java.lang.String[] aSQLInserts)
          Creates a database exception with a given severity, and with other information.
DatabaseException(java.lang.Throwable aCause, java.lang.Throwable aSecCause, java.lang.String aMsgID, java.lang.String[] aMsgInserts, int aSeverity, java.lang.String aSQL, java.lang.String[] aSQLInserts)
          Creates a database exception with a given severity, and with other information.
 
Method Summary
 java.lang.String getSQL()
           
 void setSQL(java.lang.String aSQL)
          Associates this exception with a SQL statement.
 void setSQLInserts(java.lang.String[] aSQLInserts)
          Associates this exception with a list of SQL prepared statement insert vslues.
 
Methods inherited from class com.pega.pegarules.pub.PRException
toString
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

VERSION

public static final java.lang.String VERSION
Constructor Detail

DatabaseException

public DatabaseException(java.lang.Throwable aCause,
                         java.lang.String aMsgID,
                         java.lang.String[] aMsgInserts,
                         int aSeverity,
                         java.lang.String aSQL,
                         java.lang.String[] aSQLInserts)
Creates a database exception with a given severity, and with other information. Sets the runtime status to aMsgID.

Parameters:
aCause - the exception that caused this, or null if none
aMsgID - the message to report
aMsgInserts - the message inserts, or null if none
aSeverity - the severity
aSQL - the SQL we were running when the problem occured, or null if none
aSQLInserts - the inserts for the SQL we were running, or null if none

DatabaseException

public DatabaseException(java.lang.Throwable aCause,
                         java.lang.Throwable aSecCause,
                         java.lang.String aMsgID,
                         java.lang.String[] aMsgInserts,
                         int aSeverity,
                         java.lang.String aSQL,
                         java.lang.String[] aSQLInserts)
Creates a database exception with a given severity, and with other information. Sets the runtime status to aMsgID.

Parameters:
aCause - the exception that caused this, or null if none
aSecCause - a secondary exception that may have been covered
aMsgID - the message to report
aMsgInserts - the message inserts, or null if none
aSeverity - the severity
aSQL - the SQL we were running when the problem occured, or null if none
aSQLInserts - the inserts for the SQL we were running, or null if none

DatabaseException

public DatabaseException(java.lang.Throwable aCause,
                         int aSeverity,
                         java.lang.String aDescr,
                         java.lang.String aSQL,
                         java.lang.String[] aSQLInserts)
Creates a general database exception with a given severity, and with other information. Sets the runtime status to Database-General.

Parameters:
aCause - the exception that caused this, or null if none
aSeverity - the severity
aDescr - a description of the problem
aSQL - the SQL we were running when the problem occured, or null if none
aSQLInserts - the inserts for the SQL we were running, or null if none

DatabaseException

public DatabaseException(java.lang.String aDescr)
Creates a database exception with a given message.

Parameters:
aDescr - the message

DatabaseException

public DatabaseException(int aSeverity,
                         java.lang.String aDescr)
Creates an exception with a severity and a message. Sets the runtime status to Database-General.

Parameters:
aSeverity - the severity
aDescr - the message

DatabaseException

public DatabaseException(java.lang.Throwable aCause,
                         java.lang.String aDescr)
Creates a database exception with a given message, caused by the given exception or error. Sets the runtime status to Database-General.

Parameters:
aCause - the exception or error
aDescr - the message
Method Detail

setSQL

public void setSQL(java.lang.String aSQL)
Associates this exception with a SQL statement. This should be the SQL that "caused" the exception.

Parameters:
aSQL - the SQL

setSQLInserts

public void setSQLInserts(java.lang.String[] aSQLInserts)
Associates this exception with a list of SQL prepared statement insert vslues.

Parameters:
aSQLInserts - the insert values

getSQL

public java.lang.String getSQL()
Returns:
the SQL of this Exception


Copyright © 2012 Pegasystems Inc. All Rights Reserved.