com.ibm.db.beans
Class DBException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--java.sql.SQLException
                    |
                    +--com.ibm.db.beans.DBException
All Implemented Interfaces:
java.io.Serializable

public class DBException
extends java.sql.SQLException

DBException represents exceptions that are raised by classes in com.ibm.db.beans package.

See Also:
Serialized Form

Field Summary
static int alreadyConnected
          Error code if cannot connect to database because already connected.
static int badPropertyValue
          Error code if you attempt to set a property to an invalid value.
static int badUidPwd
          Error code if the username and password specified are not valid.
static int cacheEmpty
          Error code if the result set cache is empty.
static int cannotConvert
          Error code if a String value cannot be converted to an object of another class.
static int cannotConvertToString
          Error code if cannot convert a column value to a String.
static int cannotRefreshData
          Error code if cannot refresh data in a row because the row cannot be found in the database.
static int cannotScrollBack
          Error code if cannot refetch rows displaced from the cache.
static int cannotSetAfterExecute
          Error code if the property cannot be set after executing.
static int columnAlreadyDefined
          Error code if the column with the specified number has already been defined.
static int columnNotDefined
          Error code if the column with the specified number has not yet been defined.
static int connectionClosed
          Error code if the java.sql.Connection you pass to the setConnection method is not open.
static int dbbaseDriverNotFound
          Error code if the JDBC DriverManager is unable to find a driver.
static int dbDuplicateColumn
          Error code if the specified column is already defined.
static int dbDuplicateParm
          Error code if the specified paramenter is already defined.
static int dbNotExecuted
          Error code if the SQL statement has not been executed.
static int decodeError
          Error code if a password cannot be decoded.
static int driverNotFound
          Error code if the JDBC DriverManager is unable to find a driver.
static int duplicateColumn
          Error code if the column name was already used.
static int duplicateParm
          Error code if the parameter name was already used.
static java.lang.String GENERIC_SQLSTATE
          Generic SQLState used for all DBExceptions.
static int inconsistentColumnCount
          Error code if more columns were described than were actually returned.
static int inconsistentColumnName
          Error code if a column has a different name than was specified in its meta data description.
static int indexTooLarge
          Error code if the specified row index exceeds the allowable range.
static int invalidColumnNumber
          Error code if the specified column number is less than 1.
static int invalidDeferralStyle
          Error code if you attempt to set the updateDeferral property of a DBSelect to an invalid value.
static int invalidDirection
          Error code if the specified fetch direction is neither FETCH_FORWARD (1000) nor FETCH_REVERSE (1001).
static int invalidParameterNumber
          Error code if the specified parameter number is less than 1.
static int invalidResourceLevel
          Error code if an invalid resource level is specified.
static int invalidResultNumber
          Error code if the specified result number is less than 1.
static int invalidRowNumber
          Error code if the specified row number is less than 1.
static int invalidScrollType
          Error code if an invalid scroll type specified in the DBSelect.setScrollType() method.
static int invalidSize
          Error code if the specified value for a property representing size is a negative number.
static int keyColumnMustBeSearchable
          Error code if a column identified as part of a key has a datatype that is not searchable.
static int lockNotSupported
          Error code if method lockRow not supported for database product.
static int malformedUrl
          Error code if unable to create java.net.URL from String object.
static int metaDataNotYetAvailable
          Error code if meta-data information is not yet available.
static int multipleTables
          Error code if result set is from multiple tables and update, delete or insert was requested.
static int mustApplyDeferredUpdates
          Error code if you attempt to change the update deferral style of a DBSelect when there are already pending deferred updates.
static int mustApplyRowValueChanges
          Error code if you attempt to change the update deferral style of a DBSelect when value changes have been made in the current row, but not yet applied by performing updateRow() or moving to anther row.
static int noActiveConnection
          Error code if the connection is not active.
static int noColumnUpdate
          Error code if you attempt to set a value in a column which is not enabled for updates.
static int noConnection
          Error code if there is an internal error.
static int noCurrentResult
          Error code if operation is attempted that requires that you be positioned on a result set and you are not.
static int noDeferralWithAutomaticLocking
          Error code if you attempt to put automatic row locking and the deferral of updates into effect simultaneously.
static int noDeferralWithLockedRow
          Error code if you attempt an operation that will cause a row to be locked in the database while the deferral of updates is in effect.
static int noInitialContext
          Error code if cannot connect to the database because the InitialContext cannot be created.
static int noLogWriter
          Error code if trace is turned on and the LogWriter is null.
static int noResults
          Error code if the result set is empty.
static int noResultSets
          Error code if there are no result sets.
static int noSearchableColumns
          Error code if no searchable columns are in the result set.
static int noSelectObject
          Error code if no DBSelect is associated with a DBTableModel.
static int noSQL
          Error code if the command property of a DBStatement is null or the empty string when the statement is executed.
static int noStatement
          Error code if there is an internal error.
static int noTableDefined
          Error code if the bean cannot identify the correct table in order to lock, update, insert, or delete a row, or to re-fetch data from it.
static int notCall
          Error code if the SQL statement is not a CALL statement.
static int notExecuted
          Error code if the SQL statement has not been executed.
static int notExecuting
          Error code if execution of the SQL statement cannot be canceled because the statement is not executing.
static int notOpen
          Error code if the result set is not open.
static int noTransactions
          Error code if autoCommit false not supported for database product.
static int notSelect
          Error code if the SQL statement is not a SELECT statement.
static int noValuesSet
          Error code if cannot insert because no values were set.
static int parameterAlreadyDefined
          Error code if the parameter in the specified position has already been defined.
static int parameterNotDefined
          Error code if the parameter in the specified position has not yet been defined.
static int readOnly
          Error code if the result set is read only.
static int resultNotDefined
          Error code if the result in the specified position has not yet been defined.
static int resultNotFound
          Error code if more result sets were described than were actually returned.
static int rowChanged
          Error code if the current row cannot be updated or deleted because no matching row could be found in the database.
static int rowFlaggedForDelete
          Error code if deferred changes for a DBSelect include a delete of the current row, and you then attempt to set values in the row.
static int rowNotFound
          Error code if a lock cannot be obtained on the current row because no matching row could be found in the database.
static int rowNotInDatabase
          Error code if the specified row is not in the database.
static int sqlException
          Error code if an SQLException occurred.
static int transactionIsolationError
          Error code if can't set transaction isolation level.
static int truncated
          Error code if cannot perform operation because data truncation occurred when row was retrieved.
static int unexpectedError
          Error code if an unexpected error occurs.
static int wrongObjectType
          Error code if the value used to set a column or parameter is of a different Java class than specified in the meta data.
 
Constructor Summary
DBException()
          DBException constructor comment.
DBException(java.lang.String reason)
          DBException constructor comment.
DBException(java.lang.String reason, java.lang.String sQLState)
          DBDataException constructor comment.
DBException(java.lang.String reason, java.lang.String sQLState, int errorCode)
          DBDataException constructor comment.
 
Method Summary
 int getErrorCode()
          Returns the error code associated with the exception.
 
Methods inherited from class java.sql.SQLException
getNextException, getSQLState, setNextException
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GENERIC_SQLSTATE

public static final java.lang.String GENERIC_SQLSTATE
Generic SQLState used for all DBExceptions.

See Also:
Constant Field Values

invalidRowNumber

public static final int invalidRowNumber
Error code if the specified row number is less than 1.

See Also:
Constant Field Values

columnAlreadyDefined

public static final int columnAlreadyDefined
Error code if the column with the specified number has already been defined. This can occur if you use a setColumnXXX method to implicitly define a column and set its XXX property, and then use the setColumn convenience method to set all of its primary settable properties. The setColumn method is intended to set multiple properties of a newly defined column, not to change properties of an already defined column.

See Also:
Constant Field Values

parameterAlreadyDefined

public static final int parameterAlreadyDefined
Error code if the parameter in the specified position has already been defined. This can occur if you use a setParameterXXX method to implicitly define a parameter and set its XXX property, and then use the setParameter convenience method to set all of its primary settable properties. The setParameter method is intended to set multiple properties of a newly defined parameter, not to change properties of an already defined parameter.

See Also:
Constant Field Values

columnNotDefined

public static final int columnNotDefined
Error code if the column with the specified number has not yet been defined.

See Also:
Constant Field Values

parameterNotDefined

public static final int parameterNotDefined
Error code if the parameter in the specified position has not yet been defined.

See Also:
Constant Field Values

resultNotDefined

public static final int resultNotDefined
Error code if the result in the specified position has not yet been defined.

See Also:
Constant Field Values

duplicateColumn

public static final int duplicateColumn
Error code if the column name was already used. This error can occur when you attempt to set the name or label of a column in the DBSelectMetaData object to a value that has already been used. (It is the label which must be unique, but if you have not set the label, it defaults to the name.)

See Also:
Constant Field Values

duplicateParm

public static final int duplicateParm
Error code if the parameter name was already used. This error can occur when you attempt to set the name of a parameter in the DBSelectMetaData object to a value that has already been used.

See Also:
Constant Field Values

cannotSetAfterExecute

public static final int cannotSetAfterExecute
Error code if the property cannot be set after executing. This error can occur when you first execute your SQL statement and then attempt to set a property such as optimizeConvertToString, that can only take effect before execution.

See Also:
Constant Field Values

invalidResourceLevel

public static final int invalidResourceLevel
Error code if an invalid resource level is specified. This error can occur when you specify an invalid value for the resource level parameter on the close(int) or isOpen(int) methods.

See Also:
Constant Field Values

noSelectObject

public static final int noSelectObject
Error code if no DBSelect is associated with a DBTableModel. This error can occur when execute methods of the DBTableModel before there is an associated DBSelect object.

See Also:
Constant Field Values

malformedUrl

public static final int malformedUrl
Error code if unable to create java.net.URL from String object. This error can occur when you have mapped a resultset column to the type DATALINK, but the String object retrieved from the database is not a well-formed url.

See Also:
Constant Field Values

noCurrentResult

public static final int noCurrentResult
Error code if operation is attempted that requires that you be positioned on a result set and you are not. If you are executing a stored procedure, it may be that it did not return results, or that the current result is an update count instead of a result set.

See Also:
Constant Field Values

badPropertyValue

public static final int badPropertyValue
Error code if you attempt to set a property to an invalid value.

See Also:
Constant Field Values

invalidResultNumber

public static final int invalidResultNumber
Error code if the specified result number is less than 1.

See Also:
Constant Field Values

invalidDirection

public static final int invalidDirection
Error code if the specified fetch direction is neither FETCH_FORWARD (1000) nor FETCH_REVERSE (1001).

See Also:
Constant Field Values

invalidSize

public static final int invalidSize
Error code if the specified value for a property representing size is a negative number.

See Also:
Constant Field Values

invalidColumnNumber

public static final int invalidColumnNumber
Error code if the specified column number is less than 1.

See Also:
Constant Field Values

invalidParameterNumber

public static final int invalidParameterNumber
Error code if the specified parameter number is less than 1.

See Also:
Constant Field Values

notExecuted

public static final int notExecuted
Error code if the SQL statement has not been executed. This occurs if the operation you have requested requires that the statement has been executed but it has not.

See Also:
Constant Field Values

noColumnUpdate

public static final int noColumnUpdate
Error code if you attempt to set a value in a column which is not enabled for updates. This can occur when the DBSelectMetaData.setUpdateEnabled method has been used to disable updates for the column whose value you tried to set.

See Also:
Constant Field Values

metaDataNotYetAvailable

public static final int metaDataNotYetAvailable
Error code if meta-data information is not yet available. Certain meta-data properties are not available until the statement has been executed.

See Also:
Constant Field Values

decodeError

public static final int decodeError
Error code if a password cannot be decoded. This can occur if you use setPassword(String, boolean) passing an encoded password and the value true, but the password cannot be decoded.

See Also:
Constant Field Values

sqlException

public static final int sqlException
Error code if an SQLException occurred. When this exception occurs, you can use the method getSQLException to get the SQLException itself, and examine its contents.

See Also:
Constant Field Values

badUidPwd

public static final int badUidPwd
Error code if the username and password specified are not valid. This can occur when you try to connect to the database.

See Also:
Constant Field Values

rowNotFound

public static final int rowNotFound
Error code if a lock cannot be obtained on the current row because no matching row could be found in the database. This can happen for a variety of reasons. The row could have been changed in the database independently of this object after the row data was retrieved. Data for one or more columns in the row could have been truncated or reformatted when retrieved from the database, and therefore not match the database. For example, decimal data is truncated when retrieved as an integer, timestamp data is truncated when retrieved as a date, and a date stored as a string in the database may be reformatted when retrieved as a date. These cases may go undetected since the database may not flag them with a warning.

See Also:
Constant Field Values

noConnection

public static final int noConnection
Error code if there is an internal error.

See Also:
Constant Field Values

notOpen

public static final int notOpen
Error code if the result set is not open. This occurs if the operation you have requested requires that the result set be open, but it is closed.

See Also:
Constant Field Values

connectionClosed

public static final int connectionClosed
Error code if the java.sql.Connection you pass to the setConnection method is not open. It is not possible to use a Connection object which is closed.

See Also:
Constant Field Values

dbNotExecuted

public static final int dbNotExecuted
Error code if the SQL statement has not been executed. This occurs if the operation you have requested requires that the statement has been executed but it has not.

See Also:
Constant Field Values

noResults

public static final int noResults
Error code if the result set is empty. This occurs if there are no rows in the result set and you try to perform an operation on the current row, or obtain values from a specific row via the getCacheValueAt method of DBSelect.

See Also:
Constant Field Values

readOnly

public static final int readOnly
Error code if the result set is read only. This occurs if the readOnly property has been set for the DBSelect and you attempt an operation that would change the database (such as deleteRow) or would lead to changing the database later (such as setColumn).

See Also:
Constant Field Values

rowNotInDatabase

public static final int rowNotInDatabase
Error code if the specified row is not in the database. This occurs if you try to use the lockRow method on a row you added to the result set via newRow before you have inserted it into the database. A row that is not in the database cannot be locked.

See Also:
Constant Field Values

multipleTables

public static final int multipleTables
Error code if result set is from multiple tables and update, delete or insert was requested. The columns of the result set must come from a single table to perform these operations.

See Also:
Constant Field Values

cannotConvert

public static final int cannotConvert
Error code if a String value cannot be converted to an object of another class. This occurs if the String value passed in setColumnFromString or setParameterFromString cannot be converted to an object of the appropriate type for the column or parameter.

See Also:
Constant Field Values

noActiveConnection

public static final int noActiveConnection
Error code if the connection is not active. This occurs if the operation you have requested requires that the connection to the database be open, but it is not.

See Also:
Constant Field Values

noStatement

public static final int noStatement
Error code if there is an internal error.

See Also:
Constant Field Values

dbDuplicateColumn

public static final int dbDuplicateColumn
Error code if the specified column is already defined. This error can occur when you use the addColumn method to add a column description to a StatementMetaData object, but it already has a column with the specified name.

See Also:
Constant Field Values

dbDuplicateParm

public static final int dbDuplicateParm
Error code if the specified paramenter is already defined. This error can occur when you use the addParameter method to add a parameter description to a StatementMetaData object, but it already has a parameter with the specified name.

See Also:
Constant Field Values

indexTooLarge

public static final int indexTooLarge
Error code if the specified row index exceeds the allowable range. This can occur if you specify a row number greater than the last row in the cache when calling the getCacheValueAt or setCacheValueAt method of DBSelect.

See Also:
Constant Field Values

driverNotFound

public static final int driverNotFound
Error code if the JDBC DriverManager is unable to find a driver. This can occur when you try to connect to the database if you specified values for the url and driverName properties and the DriverManager cannot find the class you specified in the driverName property.

See Also:
Constant Field Values

rowChanged

public static final int rowChanged
Error code if the current row cannot be updated or deleted because no matching row could be found in the database. This can happen for a variety of reasons. The row could have been changed in the database independently of this object after the row data was retrieved. Data for one or more columns in the row could have been truncated or reformatted when retrieved from the database, and therefore not match the database. For example, decimal data is truncated when retrieved as an integer, timestamp data is truncated when retrieved as a date, and a date stored as a string in the database may be reformatted when retrieved as a date.

See Also:
Constant Field Values

lockNotSupported

public static final int lockNotSupported
Error code if method lockRow not supported for database product. The lockRow method is not supported for Oracle, Microsoft SQL Server, Sybase SQL Server, and databases which do not support positioned updates and deletes (as reported in the JDBC DatabaseMetaData).

See Also:
Constant Field Values

noTransactions

public static final int noTransactions
Error code if autoCommit false not supported for database product. This can occur either when setting autoCommit to false while connected, or when connecting to the database after having set autoCommit to false.

See Also:
Constant Field Values

truncated

public static final int truncated
Error code if cannot perform operation because data truncation occurred when row was retrieved. This can occur when you attempt deleteRow or setColumn and a truncation warning was raised by the database when the row was fetched. If data was truncated, it will not be possible to find the correct row in the database to perform an update or delete.

See Also:
Constant Field Values

notSelect

public static final int notSelect
Error code if the SQL statement is not a SELECT statement. This occurs when you execute a DBSelect if the SQL specified in its command property is not a SELECT statement.

See Also:
Constant Field Values

notCall

public static final int notCall
Error code if the SQL statement is not a CALL statement. This occurs when you execute a DBProcedureCall if the SQL specified in its command property is not a CALL statement.

See Also:
Constant Field Values

noResultSets

public static final int noResultSets
Error code if there are no result sets. This occurs if the DBProcedureCall has no result sets and you try to set the current result set or perform an operation on the current result set.

See Also:
Constant Field Values

noValuesSet

public static final int noValuesSet
Error code if cannot insert because no values were set. This occurs when you invoke updateRow for a row added to the result set via newRow in which you have not yet set any values.

See Also:
Constant Field Values

alreadyConnected

public static final int alreadyConnected
Error code if cannot connect to database because already connected.

See Also:
Constant Field Values

notExecuting

public static final int notExecuting
Error code if execution of the SQL statement cannot be canceled because the statement is not executing. You may get this exception when using the cancelAction method to cancel a statement you are executing via the execute method or a statement you are executing via the updateRow or deleteRow methods.

The cancelAction method must be invoked from a thread other than the one in which the statement is executing, while the statment is executing.

See Also:
Constant Field Values

noSearchableColumns

public static final int noSearchableColumns
Error code if no searchable columns are in the result set. This can occur when the bean trys to locate a row in the database in order to lock it, update it, delete it, or to re-fetch data from it. The result set needs to contain at least enough searchable columns to uniquely identify a row.

See Also:
Constant Field Values

noTableDefined

public static final int noTableDefined
Error code if the bean cannot identify the correct table in order to lock, update, insert, or delete a row, or to re-fetch data from it. This can occur if your DBSelectMetaData object does not specify the table for update and the bean fails to identify a table by parsing your query.

See Also:
Constant Field Values

transactionIsolationError

public static final int transactionIsolationError
Error code if can't set transaction isolation level. This can occur either when setting the transactionIsolation property while connected, or when connecting to the database after having set the transactionIsolation property.

See Also:
Constant Field Values

cannotConvertToString

public static final int cannotConvertToString
Error code if cannot convert a column value to a String. This can happen if the cache contains a binary value, or if it contains a java.io.InputStream and an IOException occurs reading it, or if it contains a Clob which has been invalidated (by a commit for example). If you set the option validateLOBs, the bean will try to re-fetch any invalid Clobs or Blobs before reporting this error. However, under some circumstances, the re-fetch may fail. For example, it will fail if you are no longer connected to the database, or if the value you are getting was originally set by you, not fetched from the database via this result set.

See Also:
Constant Field Values

cannotRefreshData

public static final int cannotRefreshData
Error code if cannot refresh data in a row because the row cannot be found in the database. This can happen when you use the refreshRow method and the row cannot be found in the database. It can also happen when you attempt to get a column value stored in the cache as a Clob or Blob which has become invalid (due to a commit occuring, for example), and you have set the validateLOBs option to cause an attempt to refresh the value from the database, but the row cannot be found. A variety of conditions may prevent a row from being found. It could have been changed in the database independently of this object after the row data was retrieved. Data for one or more columns in the row could have been truncated or reformatted when retrieved from the database, and therefore not match the database. For example, decimal data is truncated when retrieved as an integer, timestamp data is truncated when retrieved as a date, and a date stored as a string in the database may be reformatted when retrieved as a date.

See Also:
Constant Field Values

invalidDeferralStyle

public static final int invalidDeferralStyle
Error code if you attempt to set the updateDeferral property of a DBSelect to an invalid value. Valid values are DEFER_NOTHING, DEFER_WRITE_TO_DATABASE, and DEFER_WRITE_TO_DATABASE_AND_ROW_NUMBER_CHANGE.

See Also:
Constant Field Values

mustApplyDeferredUpdates

public static final int mustApplyDeferredUpdates
Error code if you attempt to change the update deferral style of a DBSelect when there are already pending deferred updates. You must apply any deferred updates by using the applyUpdates() method before changing the update deferral style.

See Also:
Constant Field Values

noDeferralWithAutomaticLocking

public static final int noDeferralWithAutomaticLocking
Error code if you attempt to put automatic row locking and the deferral of updates into effect simultaneously. When you set the updateDeferral property of a DBSelect to DEFER_WRITE_TO_DATABASE or DEFER_WRITE_TO_DATABASE_AND_ROW_NUMBER_CHANGE, its lockRows property must be false. When you set the lockRows property of a DBSelect to true, its updateDeferral property must be set to DEFER_NOTHING.

See Also:
Constant Field Values

noDeferralWithLockedRow

public static final int noDeferralWithLockedRow
Error code if you attempt an operation that will cause a row to be locked in the database while the deferral of updates is in effect. When you set the updateDeferral property of a DBSelect to DEFER_WRITE_TO_DATABASE or DEFER_WRITE_TO_DATABASE_AND_ROW_NUMBER_CHANGE, the current row must not be locked. When you explicitly lock the current row, the updateDeferral property must be set to DEFER_NOTHING.

See Also:
Constant Field Values

mustApplyRowValueChanges

public static final int mustApplyRowValueChanges
Error code if you attempt to change the update deferral style of a DBSelect when value changes have been made in the current row, but not yet applied by performing updateRow() or moving to anther row.

See Also:
Constant Field Values

rowFlaggedForDelete

public static final int rowFlaggedForDelete
Error code if deferred changes for a DBSelect include a delete of the current row, and you then attempt to set values in the row.

See Also:
Constant Field Values

cannotScrollBack

public static final int cannotScrollBack
Error code if cannot refetch rows displaced from the cache. This can occur when you use row movement methods to move to a row that has been displaced from the cache or you use the fetchMoreRows(FETCH_REVERSE) method to fetch rows before the first row currently in the cache. In these cases, the exception occurs if the resultset is not read-only, or if the underlying database driver does not support scrollable cursors (a JDBC 2.0 feature).

See Also:
Constant Field Values

cacheEmpty

public static final int cacheEmpty
Error code if the result set cache is empty. This can occur if there are rows available to be acted upon, but none is currently in the cache. This should only occur if the cache size has been limited, and deletions have temporarily emptied the cache. Use next(), previous(), or fetchMoreRows() to get more rows into the cache.

See Also:
Constant Field Values

resultNotFound

public static final int resultNotFound
Error code if more result sets were described than were actually returned. This can occur if you provide meta data for more result sets than a stored procedure actually returns. The error may be discovered either when you execute, or when you attempt to move past the last result set, depending on your setting of the fetchAllResultsOnExecute property.

See Also:
Constant Field Values

noSQL

public static final int noSQL
Error code if the command property of a DBStatement is null or the empty string when the statement is executed. The command property must contain a valid SQL statement.

See Also:
Constant Field Values

invalidScrollType

public static final int invalidScrollType
Error code if an invalid scroll type specified in the DBSelect.setScrollType() method. Valid types are ResultSet.TYPE_SCROLL_INSENSITIVE and ResultSet.TYPE_SCROLL_SENSITIVE.

See Also:
Constant Field Values

inconsistentColumnCount

public static final int inconsistentColumnCount
Error code if more columns were described than were actually returned. This can occur if you describe columns in a DBSelectMetaData object before executing, and the result set after executing actually contains fewer columns than described.

See Also:
Constant Field Values

wrongObjectType

public static final int wrongObjectType
Error code if the value used to set a column or parameter is of a different Java class than specified in the meta data.

See Also:
Constant Field Values

unexpectedError

public static final int unexpectedError
Error code if an unexpected error occurs. The message for this exception includes a String rendering of the exception.

See Also:
Constant Field Values

noInitialContext

public static final int noInitialContext
Error code if cannot connect to the database because the InitialContext cannot be created. This can occur when you try to connect to the database if you specified a value for the dataSourceName property and the initial context factory cannot create an InitialContext to use as the starting point for finding the DataSource.

See Also:
Constant Field Values

inconsistentColumnName

public static final int inconsistentColumnName
Error code if a column has a different name than was specified in its meta data description. This can occur when you execute a DBSelect if a column name you provided in a DBSelectMetaData object before executing is different than the column name found in the java.sql.ResultSetMetaData object after executing.

See Also:
Constant Field Values

keyColumnMustBeSearchable

public static final int keyColumnMustBeSearchable
Error code if a column identified as part of a key has a datatype that is not searchable. This can occur when you execute a DBSelect if you indicated in a DBSelectMetaData object that a column is part of a key for uniquely identifying rows in the result set, but the datatype of the column is not searchable.

See Also:
Constant Field Values

dbbaseDriverNotFound

public static final int dbbaseDriverNotFound
Error code if the JDBC DriverManager is unable to find a driver. This can occur when you try to connect to the database if you specified values for the url and driverName properties and the DriverManager cannot find the class you specified in the driverName property.

See Also:
Constant Field Values

noLogWriter

public static final int noLogWriter
Error code if trace is turned on and the LogWriter is null.

See Also:
Constant Field Values
Constructor Detail

DBException

public DBException()
DBException constructor comment.


DBException

public DBException(java.lang.String reason)
DBException constructor comment.

Parameters:
reason - java.lang.String

DBException

public DBException(java.lang.String reason,
                   java.lang.String sQLState)
DBDataException constructor comment.

Parameters:
reason - java.lang.String
sQLState - java.lang.String

DBException

public DBException(java.lang.String reason,
                   java.lang.String sQLState,
                   int errorCode)
DBDataException constructor comment.

Parameters:
reason - java.lang.String
sQLState - java.lang.String
Method Detail

getErrorCode

public int getErrorCode()
Returns the error code associated with the exception.

Overrides:
getErrorCode in class java.sql.SQLException
Returns:
int