The methods in the Data Access generated classes and class library throw exceptions if something goes wrong. Use these exception IDs and the methods in IDAException in your own Data Access application to handle exceptions. The following table shows the exception IDs and associated messages used by the generated classes.
| Exception ID | Message | Cause of Exception |
|---|---|---|
| DAX_DFT_READONLY | "Cannot set read only to false. Object is read only by default." | You have tried to call setReadOnly(false) on a read-only table. |
| DAX_SYS_LOCK | N/A | For compatibility with previous releases. |
| DAX_ATTR_INVLEN | "Attribute attributeName was truncated." | The attribute was set to a value that is too long for the attribute. |
| DAX_ATTR_INVDATA | "Attribute attributeName contains non-DBCS characters." | A Double-Byte character string attribute was set to a string with non-DB characters. |
| DAX_RET_NORETRIEVE | N/A | Retrieve action is not allowed for this object. |
| DAX_AFFECT_MULTROWS | "Warning: Multiple rows affected by the methodName method. " | Multiple rows have been affected by calling an update or delete method. |
| DAX_SQL_ERROR | "SQL error occurred executing the methodName method. " | An SQL Error occurred. Also, attempted a transaction with a null datastore or while not connected. Also, attempted to insert a row that already exists. |
| DAX_OUT_OF_MEMORY | "Out of memory error." | An out-of-memory error occurred. |
| DAX_CURSOR_NOT_OPEN | "A cursor has not been opened." | A cursor action method (for example, fetchNext, updateFetched, fill, or append) was called, but not cursor is open. |
| DAX_NOT_FETCHED | "Unable to perform operation because an object has not been fetched." | Tried to call updateFetched or deleteFetched, but no row was fetched. |
| DAX_OBJ_BUSY | "Unable to perform operation because the object is busy processing another request." | The object is busy running a method (on a background thread). |
| DAX_NO_RESULTS | "No results were produced by the methodName method. " | The target row not found for a delete, update or retrieve method. |
| DAX_METH_READONLY | "The methodName method cannot be used on a readonly object." | Attempted an update-type method when isReadOnly is set to true. |
| DAX_NOT_NULLABLE | "The column columnName is not nullable." | You cannot set attributes from this column to null. |
| DAX_METHOD_NOT_IMPL | "The methodName method has not been implemented." | The called method has not been implemented (It may have been excluded from the generated code). |
| DAX_CANCEL_FAILED | "An error occured on cancel. " | A cancel method call failed. |
| DAX_NO_CRSR_AVAIL | "Could not get a cursor. All static cursors for this query are in use. " | No cursor available for a query (static SQL only). |
| DAX_CRSR_NOT_UPD | "UpdateFetched/deleteFetched failed. Cursor not opened FOR UPDATE." | Attempted to delete or update a row, but the cursor pointing at the row was not opened with 'FOR UPDATE' parameter (static SQL only). |
| DAX_ESQL_ERROR | "SQL error occurred executing the methodName method. SQLCODE: code SQLSTATE state" | An embedded SQL error occurred. |
| DAX_ESQL_NO_RESULTS | "No results were produced by the methodName method. SQLCODE: code SQLSTATE state" | An ESQL method had no results. |
| DAX_INVALID_DATE_FORMAT | "Invalid date format." | IDate attribute was set to an invalid value (IDate attributes must have the format YYYY-MM-DD). |
| DAX_INVALID_TIME_FORMAT | "Invalid time format." | ITime attribute was set to an invalid value (ITime attributes must have the format HH:MM:SS). |
| DAX_INVALID_TIMESTAMP_FORMAT | "Invalid timestamp format." | ITimestamp attribute was set to an invalid value (ITimestamp attributes must have the format YYYY-MM-DD-HH:MM:SS.NNNNNNNNN). |
| DAX_INVALID_FORMAT | "Invalid type format." | An attribute was set to an invalid format. |
The following table shows the exception IDs and the associated messages used by the Data Access class library.
| Exception ID | Message | Cause of Exception |
|---|---|---|
| DAX_MSG_MAX_CONNECTIONS_ REACHED |
"The maximum number of DatastoreManager connections have been reached." | The maximum number of connections allowed has been reached. |
| DAX_MSG_NO_CONNECT_TRANSACT_ ACTIVE |
"Cannot connect while a transaction is in progress." | Attempted to connect while a transaction is already in progress. |
| DAX_MSG_MAX_CONNECTIONS_TO_ DB_REACHED |
"The maximum number of datastore connections have been reached." | The maximum number of connections to a database has been reached. |
| DAX_MSG_CONNECTION_IN_USE | "The connection is already in use." | The specified connection is already in use. |
| DAX_MSG_NO_DISCONNECT_ CONNECTION_NOT_FOUND |
"Cannot disconnect: Connection not found." | Tried to disconnect when there was no connection. |
| DAX_MSG_COMMIT_ERROR | "Commit error occurred." | An error occurred during a commit method call. |
| DAX_MSG_ROLLBACK_ERROR | "Rollback error occurred." | An error occurred during a rollback method call. |
| DAX_MSG_CONNECT_ERROR | "Connect error occurred." | An error occurred during an attempt to connect. |
| DAX_MSG_DISCONNECT_ERROR | "Disconnect error occurred." | An error occurred during an attempt to disconnect. |
| DAX_MSG_CONNECT_NOT_OPEN | "Connection is not open." | The specified connection is not open. |
| DAX_MSG_LOGON_ERROR | "Logon error occurred." | An error occurred during a logon attempt. |
| DAX_MSG_LOGOFF_ERROR | "Logoff error occurred." | An error occurred during a logon attempt. |
| DAX_MSG_USERID_NOT_SPECIFIED | "Userid must be specified." | The logon attempt could not be completed because no user ID was specified. |
| DAX_MSG_PASSWORD_NOT_SPECIFIED | "Authentication must be specified." | The logon attempt could not be completed because no password (authentication) was specified. |
| DAX_MSG_INCORRECT_USERID_ OR_PASSWORD |
"Userid or authentication is incorrect." | The logon attempt could not be completed because an incorrect user ID or password was specified. |
| DAX_MSG_LOGON_IN_PROGRESS | "Logon is in progress. Try to logon later." | A logon attempt was already in progress. |
| DAX_MSG_INVALID_REMOTE_TYPE | "Remote type is not valid." | The remote type specified is not valid. |
| DAX_MSG_EXECUTE_IMMEDIATE_ERROR | "An SQL Execute Immediate error occurred." | A DB2 ESQL Execute Immediate error occurred. |
| DAX_MSG_ONLY_ONE_CONNECTION_ ALLOWED |
"Only one connection is allowed at a time." | Only one active ESQL connection per application is permitted. |
| DAX_MSG_OBJECT_NOT_FOUND_ OR_NOT_INSERTED |
"Cannot find or insert object." | An object could not be found or could not be inserted. |
| DAX_MSG_OBJECT_NOT_UNIQUE | "Object is not unique." | An update or delete action has affected more than one row of the table. |
| DAX_MSG_ERROR_IN_SQLERROR | "Error occurred in SQLError, rc = code." | An SQL error occurred while obtaining the SQL error information. |
| DAX_MSG_ADD_NOT_IMPLEMENTED | "Add is not implemented for this object." | The add method is not implemented. |
| DAX_MSG_UPDATE_NOT_IMPLEMENTED | "Update is not implemented for this object." | The update method is not implemented. |
| DAX_MSG_DEL_NOT_IMPLEMENTED | "Delete is not implemented for this object." | The delete method is not implemented. |
| DAX_MSG_RETRIEVE_NOT_ IMPLEMENTED |
"Retrieve is not implemented for this object." | The retrieve method is not implemented. |
| DAX_MSG_DEFAULT_READONLY | "Cannot setReadOnly(False) on a default read-only object." | Attempted to change the read-only setting of a default read-only class (cannot be changed because the table is read-only). |
| DAX_MSG_RETRIEVEALL_NOT_ IMPLEMENTED |
"RetrieveAll is not implemented for this object." | The retrieveAll method is not implemented. |
| DAX_MSG_INVALID_CONNECTION_ HANDLE |
"Connection handle is not valid." | The ODBC/CLI connection handle is not valid. |
| DAX_MSG_INVALID_STATEMENT_HANDLE | "Statement handle is not valid." | The ODBC/CLI statement handle is not valid. |
| DAX_MSG_SQLERROR | "SQL Error, rc = code" | The indicated SQL error occurred. |
| DAX_MSG_SELECT_NOT_IMPLEMENTED | "Select is not implemented for this object." | The select method is not implemented. |
| DAX_MSG_DATASTORE_CONNECTION_ NOT_SUPPLIED |
"Datastore connection must be supplied." | The application has not provided a datastore connection for the object, nor has it specified a default connection for objects of the class. |
| DAX_MSG_LOCK_ERROR | "Error occurred in system locking/semaphore call, rc = code." | An operating system error occurred while application was in a locking call. |
| DAX_MSG_UNKNOWN_EXCEPTION_ OCCURRED |
"Unknown exception occurred." | An exception that was not an IException occurred. |
| DAX_MSG_COMMIT_ERROR_BIND | "Commit error: did not bind class library." | Commit error; did not bind class library. |
| DAX_MSG_ROLLBACK_ERROR_BIND | "Rollback error: did not bind class library." | Rollback error; did not bind class library. |
| DAX_MSG_OBJECT_ALREADY_BUSY | "Background thread object is already busy." | A background thread object is already busy. |
| DAX_MSG_ATTR_INVLEN | "Attribute was truncated." | An attribute converts to an invalid length and will not fit in the buffer. |
| DAX_MSG_INVALID_PARAMETER | "method (param) - Parameter is invalid." | The parameter passed into the indicated method is not valid. |
| DAX_MSG_INVALID_ENVIRONMENT_ HANDLE |
"Environment handle is not valid." | The ODBC/CLI Environment handle is not valid. |
| DAX_MSG_CANNOT_LOAD_DRIVER | "Cannot load driver: driverName." | The indicated driver could not be loaded. |
| DAX_MSG_CONNECT_CANCELLED | "Connect attempt was cancelled by user." | The user cancelled the connect attempt. |
| DAX_MSG_OBJECT_NOT_FETCHED | "Invalid operation: Object must be fetched before update or delete." | deleteFetched or updateFetched was called, but the current row was not fetched. |
| DAX_MSG_OUT_OF_MEMORY | "Out of memory error occurred." | Application ran out of memory. |
| DAX_MSG_INVALID_ISOLATION_LEVEL | "Isolation level is not valid." | The specified isolation level is not valid. See "Isolation and Locking" for information. |
| DAX_MSG_INVALID_AUTOCMT_VALUE | "Autocommit value is not valid." | The specified autocommit value is not valid. |
| DAX_MSG_CANT_START_DB_MANAGER | "Error errorNumber occurred while starting the database manager." | The specified error occurred while the database manager was starting. |
| DAX_MSG_CANT_STOP_DB_MANAGER | "Error errorNumber occurred while stopping the database manager." | The specified error occurred while the database manager was stopping. |
| DAX_MSG_UNSUPPORTED_SQLTYPE | "SQLTYPE(type) is not supported." | The database SQL type is not supported. |
| DAX_MSG_GUI_NOT_INITIALIZED | "Background threaded action can only be started from a GUI enabled thread." | You cannot put a method on a background thread unless it comest from a GUI-enabled thread. |
| DAX_MSG_INVALID_FILE_OPT | "An invalid file option was given." | For saving a LOB to a file, an invalid File option was specified. |
| DAX_MSG_UNABLE_TO_WRITE_FILE | "The file: <filename> could not be opened for write" | For saving a LOB to a file, could not write to the specified file. |
| DAX_MSG_FILE_NO_EXIST | "The file: <filename> does not exist." | For saving a LOB to a file, specified file does not exist (Specify the create option instead of the write option). Or, when reading a LOB from a file, unable to find the file. |
| DAX_MSG_UNABLE_TO_READ_FILE | "The file: <filename> could not be opened for read." | For reading a LOB from a file, could not read from the specified file. |
| DAX_MSG_INCOMPATIBLE_LOB_TYPES | "Operation could not be performed. LOB types are incompatible." | Do not try to add different type s of LOB, or insert one type into another (for example, do not add a BLOB to a CLOB). |
| DAX_MSG_BOUNDARY_EXCEEDED | "Error: insert/overlayWith exceeds LOB boundaries." | When you insert an object into a LOB, or overlay part of a LOB with an object, the object may not exceed the length of the original LOB plus the specified additional length. |
Compatibility with previous releases
To be backward compatible with previous releases of VisualAge C++, the following
generated code error IDs from the earlier releases have been mapped to IDs in this
release:
| VisualAge C++ v. 3.5 and earlier | VisualAge C++ v. 4.0 |
|---|---|
| DAX_RET_SQLERR | DAX_SQL_ERROR |
| DAX_ADD_SQLERR | DAX_SQL_ERROR |
| DAX_UPD_SQLERR | DAX_SQL_ERROR |
| DAX_DEL_SQLERR | DAX_SQL_ERROR |
| DAX_DEL_MULTROWS | DAX_AFFECT_MULTROWS |
| DAX_UPD_MULTROWS | DAX_AFFECT_MULTROWS |
| DAX_ADD_READONLY | DAX_METH_READONLY |
| DAX_UPD_READONLY | DAX_METH_READONLY |
| DAX_DEL_READONLY | DAX_METH_READONLY |
| DAX_REF_SQLERR | DAX_SQL_ERROR |
| DAX_SEL_SQLERR | DAX_SQL_ERROR |
