Where Am I? Class Hierarchy All Classes All Fields and Methods

Class com.ibm.db.DataException

java.lang.Object
   |
   +----java.lang.Throwable
           |
           +----java.lang.Exception
                   |
                   +----com.ibm.db.DataException

public class DataException
extends Exception

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


Field Index

alreadyConnected
Error code if cannot connect to database because already connected.
badJavaClass
Error code if an invalid Java Class specified.
badSQLType
Error code if an invalid/unsupported SQL type is specified.
badUidPwd
Error code if an invalid userID or password specified.
beforeCacheStart
Error code if the specified row is before the start of the cache.
beforeResultCacheStart
Error code if the specified result set is before the start of the cache.
cannotConvert
Error code if a String value cannot be converted to an object of another class.
cloneNotSupported
Error code if the object does not support cloning.
connectionClosed
Error code if the JDBC connection you pass to the DatabaseConnection constructor is not open.
decodeError
Error code if a decode error encountered.
driverNotFound
Error code if the JDBC driver class not found when attempting to connect.
duplicateColumn
Error code if the specified column is already defined.
duplicateParm
Error code if the specified paramenter is already defined.
errorMakeField
Error code if an unsupported Java class specified for column/parameter.
externallyManaged
Error code if the connection is externally managed.
illegalAccess
Error code if the newInstance method of a Class object fails because the class or initializer is not accessible.
inconsistentColumnCount
Error code if the number of columns in a result set does not match the number of columns specified in the StatementMetaData.
inconsistentColumns
Error code if the defined columns are inconsistent with SQL statement.
inconsistentColumnType
Error code if the SQL data types of columns in a result set do not match the SQL data types of columns specified in the StatementMetaData.
indexTooLarge
Error code if the specified row index exceeds the allowable range.
instantiationException
Error code if the newInstance method of a Class object fails because the Class object is abstract or an interface.
internalError
Error code if an internal error occurred.
invalidConnPoolType
Error code if an invalid connection pool type was specified.
lockNotSupported
Method lockRow not supported for database product.
maxSize
Error code if newRow failed because result set max size limit reached.
multipleTables
Error code if result set is from multiple tables and update, delete or insert was requested.
noActiveConnection
Error code if the connection is not active.
noConnection
Error code if there is no associated DatabaseConnection.
noConnectionSpec
Error code if an error occured creating a DatabaseConnectionSpec.
noGui
Error code if no GUI is available.
noLogonSpec
Error code if an error occured creating a DatabaseLogonSpec.
noMetaData
Error code if there is no associated StatementMetaData.
noResults
Error code if the result set is empty.
noResultSets
Error code if there are no result sets.
noSQL
Error code if no SQL Statement is specified.
noStatement
Error code if there is no associated Statement object.
noStatementMetaData
Error code if an error occurred creating StatementMetaData.
noSuchColumn
Error code if the specified column is not defined.
noSuchParm
Error code if the specified parameter is not defined.
noSuchTable
Error code if the specified table is not defined.
notCall
Error code if the SQL statement is not a CALL statement.
notExecuted
Error code if the SQL statement has not been executed.
notExecuting
Error code if execution of the SQL statement cannot be canceled because the statement is not executing.
notOpen
Error code if the result set is not open.
noTransactions
AutoCommit false not supported for database product.
notRegistered
Error code if the connection alias is not registered.
notSelect
Error code if the SQL statement is not a SELECT statement.
noValuesSet
Error code if cannot insert because no values were set.
readOnly
Error code if the result set is read only.
resultIndexTooLarge
Error code if the specified result set index exceeds the allowable range.
rowChanged
Error code if the current row cannot be updated or deleted because no matching row could be found in the database.
rowNotFound
Error code if a lock cannot be obtained on the current row because no matching row could be found in the database.
rowNotInDatabase
Error code if the specified row is not in the database.
SQLDisconnectException
Error code if an exception occurred during disconnect.
sqlException
Error code if an SQLException occurred.
truncated
Error code if cannot perform operation because data truncation occurred when row was retrieved.
unzipError
Error code if an unzip error encountered.
websphereConnectionError
Error code if error was encountered obtaining a connection from or releasing a connection to a WebSphere connection pool.
wrongObjectType
Error code if the wrong object type is used to update column/parameter.
zipError
Error code if a zip error encountered.

Constructor Index

DataException(String, int)
Constructs a new DataException with the specified message and error code.
DataException(String, SQLException)
Constructs a new DataException with the specified message and associates the specified SQLException with the DataException.

Method Index

getErrorCode()
Returns the error code associated with the exception.
getSQLException()
Returns the SQLException that is associated with the DataException.

Fields

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

badJavaClass
 public static final int badJavaClass
Error code if an invalid Java Class specified. This occurs if you pass a null value for the javaClass parameter of the addColumn or addParameter method of StatementMetaData.

badSQLType
 public static final int badSQLType
Error code if an invalid/unsupported SQL type is specified. This can occur when you use the addColumn or addParameter method to describe a column or parameter in the StatementMetaData and you specify a value for the targetSQLType parameter which is not recognized. It can also occur when you retrieve a result set returned by a query or a stored procedure, and it includes a column whose SQL data type is not recognized. In either case, you can avoid the error by using the addColumn or addParameter method of StatementMetaData to specify a suitable recognized target SQL data type or a specific java class to use for the column or parameter.

badUidPwd
 public static final int badUidPwd
Error code if an invalid userID or password specified. This can occur during the connect method.

beforeCacheStart
 public static final int beforeCacheStart
Error code if the specified row is before the start of the cache. This occurs if you try to set the current row to a row before the first, or to a row that has been displaced from the cache. Once a row has been displaced, you cannot position to it again without re-executing the query.

beforeResultCacheStart
 public static final int beforeResultCacheStart
Error code if the specified result set is before the start of the cache. This occurs if you try to set the current result set to a result set before the first, or to a result set that has been displaced from the cache. Once a result set has been displaced, you cannot position to it again without re-executing the query.

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 setColumnValueFromString or setParameterFromString cannot be converted to an object of the appropriate type for the column or parameter.

cloneNotSupported
 public static final int cloneNotSupported
Error code if the object does not support cloning. This is an internal error that should not occur under normal conditions.

connectionClosed
 public static final int connectionClosed
Error code if the JDBC connection you pass to the DatabaseConnection constructor is not open. This occurs when you attempt to create a new externally-managed DatabaseConnection object and the java.sql.Connection object you pass to the constructor is not connected to a database.

decodeError
 public static final int decodeError
Error code if a decode error encountered. This can occur when you use the setPassword message and request that the password be decoded before it is saved. The password could not be decoded.

driverNotFound
 public static final int driverNotFound
Error code if the JDBC driver class not found when attempting to connect.

duplicateColumn
 public static final int duplicateColumn
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.

duplicateParm
 public static final int duplicateParm
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.

errorMakeField
 public static final int errorMakeField
Error code if an unsupported Java class specified for column/parameter. This occurs if the value you pass for the javaClass parameter of the addColumn or addParameter method of StatementMetaData is not recognized as a valid class to contain data for a column or parameter.

externallyManaged
 public static final int externallyManaged
Error code if the connection is externally managed. A DatabaseConnection object is externally managed if it was created using the constructor that takes a java.sql.Connection parameter. The only operation currently disallowed for externally managed connections is connect.

illegalAccess
 public static final int illegalAccess
Error code if the newInstance method of a Class object fails because the class or initializer is not accessible. This is an internal error that should not occur under normal conditions.

inconsistentColumnCount
 public static final int inconsistentColumnCount
Error code if the number of columns in a result set does not match the number of columns specified in the StatementMetaData. If you have defined a StatementMetaData object that describes one or more columns in the result set, the number of columns described must match the number actually returned.

inconsistentColumns
 public static final int inconsistentColumns
Error code if the defined columns are inconsistent with SQL statement. This error code is no longer used. It has been replaced by inconsistentColumnCount and inconsistentColumnType.

inconsistentColumnType
 public static final int inconsistentColumnType
Error code if the SQL data types of columns in a result set do not match the SQL data types of columns specified in the StatementMetaData. If you have defined a StatementMetaData object that describes one or more columns in the result set, the SQL data types of columns described must match the SQL data types actually returned.

indexTooLarge
 public static final int indexTooLarge
Error code if the specified row index exceeds the allowable range. This can occur if you attempt to set the current row in a result set to a number greater than the number of rows returned. It can also occur if you specify a row number greater than the last row in the cache when calling the getCacheValueAt method of SelectResult.

instantiationException
 public static final int instantiationException
Error code if the newInstance method of a Class object fails because the Class object is abstract or an interface. This is an internal error that should not occur under normal conditions.

internalError
 public static final int internalError
Error code if an internal error occurred.

invalidConnPoolType
 public static final int invalidConnPoolType
Error code if an invalid connection pool type was specified. This occurs if a value other than POOL_TYPE_WEBSPHERE or POOL_TYPE_NONE was used for the setConnectionPoolType.

lockNotSupported
 public static final int lockNotSupported
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).

maxSize
 public static final int maxSize
Error code if newRow failed because result set max size limit reached. This occurs if you have set the maximumRows property of a statement to a non-zero limit. This limit not only prevents rows beyond the limit from being fetched from the database, but also from being added to the cache via newRow.

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.

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.

noConnection
 public static final int noConnection
Error code if there is no associated DatabaseConnection. This occurs if the operation you have requested requires a DatabaseConnection object, and no association to a DatabaseConnection object has been defined. This is an internal error that should not occur under normal conditions.

noConnectionSpec
 public static final int noConnectionSpec
Error code if an error occured creating a DatabaseConnectionSpec. A DatabaseConnectionSpec is an object used internally within a DatabaseConnection to store information required to perform a connect. This error indicates a failure to create an empty DatabaseConnectionSpec for a new DatabaseConnection.

noGui
 public static final int noGui
Error code if no GUI is available. This occurs if the promptUID property of a DatabaseConnection object is true, but when attempting to connect at runtime, the environment does not allow a graphic user interface to be used to obtain the userid and password.

noLogonSpec
 public static final int noLogonSpec
Error code if an error occured creating a DatabaseLogonSpec. A DatabaseLogonSpec is an object used internally within a DatabaseConnection to store userid and password information. This error indicates a failure to create an empty DatabaseLogonSpec for a new DatabaseConnection.

noMetaData
 public static final int noMetaData
Error code if there is no associated StatementMetaData. This occurs if the operation you have requested requires an associated StatementMetaData object and there is none. This error code is not currently used.

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 set the current row, perform an operation on the current row, or obtain values from a specific row via the getCacheValueAt method of SelectResult.

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

noSQL
 public static final int noSQL
Error code if no SQL Statement is specified. The SQL statement specified in StatementMetaData is either null or an empty string.

noStatement
 public static final int noStatement
Error code if there is no associated Statement object. This occurs if the operation you have requested requires an associated SelectStatement, ModifyStatement, or CallableStatement and there is none.

noStatementMetaData
 public static final int noStatementMetaData
Error code if an error occurred creating StatementMetaData. This error can occur when attempting to create an empty default StatementMetaData object for a Statement.

noSuchColumn
 public static final int noSuchColumn
Error code if the specified column is not defined. This occurs if the index or name used to identify a column is not defined in the StatementMetaData. This error code is not used. An ArrayIndexOutOfBoundsException is thrown instead, with a message that describes this specific condition.

noSuchParm
 public static final int noSuchParm
Error code if the specified parameter is not defined. This occurs if the index or name used to identify a parameter is not defined in the StatementMetaData. This error code is not used. An ArrayIndexOutOfBoundsException is thrown instead, with a message that describes this specific condition.

noSuchTable
 public static final int noSuchTable
Error code if the specified table is not defined. This error can occur when you use the removeTable method to remove a table from the list in a StatementMetaData object, but the table you specify is not found in the list.

notCall
 public static final int notCall
Error code if the SQL statement is not a CALL statement. This occurs for a CallableStatement if the SQL specified in the StatementMetaData is not a CALL statement.

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.

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 either when using the cancelExecution method to cancel a statement you are executing via the execute method or when using the cancelAction method to cancel a statement you are executing via the updateRow or deleteRow methods.

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

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.

noTransactions
 public static final int noTransactions
AutoCommit false not supported for database product.

notRegistered
 public static final int notRegistered
Error code if the connection alias is not registered. An internal registry is kept of all connection aliases currently in use. This error occurs if when you disconnect, your connection alias is not found in the registry. This is an internal error that should not occur under normal conditions.

notSelect
 public static final int notSelect
Error code if the SQL statement is not a SELECT statement. This occurs for a SelectStatement if the SQL specified in the StatementMetaData is not a SELECT statement.

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.

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 statement and you attempt an operation that would change the database (such as deleteRow) or would lead to changing the database later (such as setColumnValue).

resultIndexTooLarge
 public static final int resultIndexTooLarge
Error code if the specified result set index exceeds the allowable range. This can occur if you attempt to set the current result set to a number greater than the number of result sets returned.

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.

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.

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.

SQLDisconnectException
 public static final int SQLDisconnectException
Error code if an exception occurred during disconnect. This error code is no longer used.

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.

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 setColumnValue 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.

unzipError
 public static final int unzipError
Error code if an unzip error encountered. This error code is no longer used.

websphereConnectionError
 public static final int websphereConnectionError
Error code if error was encountered obtaining a connection from or releasing a connection to a WebSphere connection pool. This may occur during connect or disconnect if you are using WebSphere connection pools.

wrongObjectType
 public static final int wrongObjectType
Error code if the wrong object type is used to update column/parameter. This occurs if the object you pass as the new value on setColumnValue or setParameter has a different java class than expected for the column or parameter based on the StatementMetaData.

zipError
 public static final int zipError
Error code if a zip error encountered. This error code is no longer used.


Constructors

DataException
 public DataException(String message,
                      int errorCode) 
Constructs a new DataException with the specified message and error code.

Parameters:
message - the exception message
errorcode - the error code
DataException
 public DataException(String message,
                      SQLException ex) 
Constructs a new DataException with the specified message and associates the specified SQLException with the DataException.

Parameters:
message - the exception message
ex - the associated SQLException

Methods

getErrorCode
 public int getErrorCode() 
Returns the error code associated with the exception. The error codes are defined as fields in DataException.

Returns:
the error code.
getSQLException
 public SQLException getSQLException() 
Returns the SQLException that is associated with the DataException. If the error code for this exception is not sqlException, this method returns a null.

Returns:
the SQLException

Where Am I? Class Hierarchy All Classes All Fields and Methods