borland.jbcl Packages  borland.jbcl Class Hierarchy  borland.jbcl.dataset 

DataSetException class

java.lang.Object
   +----java.lang.Throwable
           +----java.lang.Exception
                   +----borland.jbcl.dataset.DataSetException
                           +----borland.jbcl.dataset.ValidationException
                           +----borland.jbcl.dataset.ResolutionException

About the DataSetException class

Variables  Constructors  Properties  Methods  

Implements ChainedException, Serializable

The DataSetException class extends the java.lang.Exception class and is used heavily by the dataset package. It encapsulates common errors that can be generated, and behavior necessary to access this error information.

The DataSetException class can have other types of exceptions chained to them, for example, java.io.IOException and java.sql.SQLException exceptions. In these cases the DataSetException has an appropriate message that describes the error from the perspective of the higher level API.

Programmatically, use the getExceptionChain() to obtain any chained exception. A chained exception (a singly linked list) can contain non-DataSetException exceptions that were encountered at a lower level API.

The dataset package has some built-in DataSetException handling support for JBCL data-aware controls. The controls themselves don't know what a DataSetException is. They simply expect all of their data update and access operations to work, leaving the handling of errors to the built-in DataSetException. For JBCL data aware controls, the default DataSetException error handling works as follows at runtime:

The DataSetException class is extended by borland.jbcl.dataset.ValidationException and borland.jbcl.dataset.ResolutionException classes.


DataSetException variables

Variables implemented in this class

DataSetException constructors

DataSetException properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.lang.Object

Properties implemented in java.lang.Throwable

DataSetException methods

Methods implemented in this class

Methods implemented in java.lang.Object

Methods implemented in java.lang.Throwable


DataSetException variables

ALREADY_LOADING

  public static final int ALREADY_LOADING = BASE+28
The DataSet cannot be loaded or is not in load mode. Unexpected Internal error.

BAD_QUERY_PROPERTIES

  public static final int BAD_QUERY_PROPERTIES = BASE+1
One or more connection properties of the Database or query properties of the QueryDataSet are not set.

CANNOT_CHANGE_COLUMN

  public static final int CANNOT_CHANGE_COLUMN = BASE+70
Cannot make the requested change to the Column. Use Column.clone() before applying changes.

CANNOT_CHANGE_COLUMN_DATA_TYPE

  public static final int CANNOT_CHANGE_COLUMN_DATA_TYPE = BASE+14
Cannot change the data type of the Column because the Column already contains data.

CANNOT_FIND_TABLE_NAME

  public static final int CANNOT_FIND_TABLE_NAME = BASE+7
Cannot determine the table name for the query property of the QueryDataSet from metadata or from parsing the query property.

CANNOT_IMPORT_NULL_DATASET

  public static final int CANNOT_IMPORT_NULL_DATASET = BASE+9
The DataSet must contain Columns before data can be imported.

CANNOT_REFRESH

  public static final int CANNOT_REFRESH = BASE+77
Cannot refresh the current DataSet.

CANNOT_SAVE_CHANGES

  public static final int CANNOT_SAVE_CHANGES = BASE+76
Cannot save changes in the current DataSet.

CANNOT_UPDATE_SCOPED_DATA_ROW

  public static final int CANNOT_UPDATE_SCOPED_DATA_ROW = BASE+30
Cannot modify Column elements in a scoped DataRow. Create a new scoped DataRow if needed.

COLUMN_ALREADY_BOUND

  public static final int COLUMN_ALREADY_BOUND = BASE+13
The Column is already bound to a DataSet. Use Column.clone() to add this column.

COLUMN_NOT_IN_ROW

  public static final int COLUMN_NOT_IN_ROW = BASE+19
The Column is in the DataSet but was excluded from the row.

COLUMN_TYPE_CONFLICT

  public static final int COLUMN_TYPE_CONFLICT = BASE+11
Failed to add a Column with the same name, but different data type as an existing Column.

CONNECTION_DESCRIPTOR_NOT_SET

  public static final int CONNECTION_DESCRIPTOR_NOT_SET = BASE+45
Cannot open a Database unless the ConnectionDescriptor is set. From the JBuilder UI, set the connection property of the Database component.

CONNECTION_NOT_CLOSED

  public static final int CONNECTION_NOT_CLOSED = BASE+80
Connection could not be closed.

DATASET_CORRUPT

  public static final int DATASET_CORRUPT = BASE+35
Operation failed. The DataSet structure is corrupt.

DATASET_HAS_NO_ROWS

  public static final int DATASET_HAS_NO_ROWS = BASE+41
Invalid access on an empty DataSet. If working with a master-detail relationship where the master DataSet has no rows and the details are being fetched as needed, add persistent Columns to the detail DataSet. This allows the initialization logic to determine the Columns of the detail DataSet.

DATASET_HAS_NO_TABLES

  public static final int DATASET_HAS_NO_TABLES = BASE+18
Save operation failed. None of the DataSet class Columns that are updatable have a table name.

DATASET_NOT_OPEN

  public static final int DATASET_NOT_OPEN = BASE+42
Operation failed. The DataSet is not open.

DATASET_OPEN

  public static final int DATASET_OPEN = BASE+39
Operation cannot be performed on an open DataSet. Close the DataSet first.

DATA_FILE_LOAD_FAILED

  public static final int DATA_FILE_LOAD_FAILED = BASE+60
The DataFile load operation failed.

DUPLICATE_COLUMN_NAME

  public static final int DUPLICATE_COLUMN_NAME = BASE+36
Duplicate value for the columnName property in this DataSet.

EMPTY_COLUMN_NAMES

  public static final int EMPTY_COLUMN_NAMES = BASE+20
List of Columns is null or empty.

EXCEPTION_CHAIN

  public static final int EXCEPTION_CHAIN = BASE+47
Exception chain

FIELD_POST_ERROR

  public static final int FIELD_POST_ERROR = BASE+81
The field value cannot be posted. This error occurs when a DataSet requests that a data aware control post field values being edited and the field value cannot be posted (most likely due to a ValidationException error). Unfortunately controls do not currently provide any information on why a post failed.

INCOMPATIBLE_DATA_ROW

  public static final int INCOMPATIBLE_DATA_ROW = BASE+31
Attempt to use a DataRow with a DataSet that are no longer synchronized. A DataRow must be created with the DataSet it is used with. If the structure of a DataSet changes, a new DataRow must be created for it.

INSUFFICIENT_ROWID

  public static final int INSUFFICIENT_ROWID = BASE+73
The DataSet.refetchRow() method was called with an insufficient rowId (row identifier).

INVALID_AGG_DESCRIPTOR

  public static final int INVALID_AGG_DESCRIPTOR = BASE+46
Operation failed. The AggDescriptor has no groupColumns, or some groupColumns do not exist in the DataSet.

INVALID_COLUMN_POSITION

  public static final int INVALID_COLUMN_POSITION = BASE+12
The Column postion is out of range.

INVALID_COLUMN_TYPE

  public static final int INVALID_COLUMN_TYPE = BASE+49
Operation failed. Invalid Column data type for a DataSet.

INVALID_DATA_FILE_FORMAT

  public static final int INVALID_DATA_FILE_FORMAT = BASE+32
Attempt load or save a DataSet with an invalid DataFileFormat property setting. See DataFileFormat for valid file format settings.

INVALID_FORMAT

  public static final int INVALID_FORMAT = BASE+71
column formatting error for default, min, max values using edit mask or display format.

INVALID_SCHEMA_FILE

  public static final int INVALID_SCHEMA_FILE = BASE+50
Invalid schema file.

INVALID_SORT_COLUMN

  public static final int INVALID_SORT_COLUMN = BASE+48
Operation failed. Attempt to sort on non sortable Column, for example a Binary Column.

IO_ERROR

  public static final int IO_ERROR = BASE+79
Operation failed due to an IO error.

LINK_COLUMNS_ERROR

  public static final int LINK_COLUMNS_ERROR = BASE+33
The number and data type of Columns in the MasterLinkColumns and DetailLinkColumns must match.

LOADING_NOT_STARTED

  public static final int LOADING_NOT_STARTED = BASE+29
Cannot load data into the DataSet. The DataSet is not in load mode. Unexpected Internal error.

MASTER_DETAIL_VIEW_ERROR

  public static final int MASTER_DETAIL_VIEW_ERROR = BASE+34
The SortDescriptor keys property setting is not compatible with the DataSet linkColumns property. The keys property must start with all the Columns specified in the MasterLinkColumns and DetailColumns properties.

MASTER_NAVIGATION_ERROR

  public static final int MASTER_NAVIGATION_ERROR = BASE+43
Error in navigating master DataSet.

MISMATCHED_PARAMETER_FORMAT

  public static final int MISMATCHED_PARAMETER_FORMAT = BASE+5
Cannot mix named parameters and '?' parameter markers.

MISSING_MASTER_DATASET

  public static final int MISSING_MASTER_DATASET = BASE+65
Detail DataSet being resolved without a master DataSet.

MISSING_RESOLVER

  public static final int MISSING_RESOLVER = BASE+64
Resolver object missing.

MULTIPLE_ROWS_AFFECTED

  public static final int MULTIPLE_ROWS_AFFECTED = BASE+38
More than one row was affected by resolution query (either DELETE or UPDATE query).

NEED_LOCATE_START_OPTION

  public static final int NEED_LOCATE_START_OPTION = BASE+24
Must specify one of First, Last, Next, Prior for locate operations (see borland.jbcl.dataset.Locate).

NON_EXISTENT_ROWID

  public static final int NON_EXISTENT_ROWID = BASE+74
DataSet.refetchRow() was called with non existent rowId (row identifier).

NOT_DATABASE_RESOLVER

  public static final int NOT_DATABASE_RESOLVER = BASE+67
Trying to use the Database component to save changes to a DataSet with a non-DatabaseResolver derived resolver.

NOT_SELECT_QUERY

  public static final int NOT_SELECT_QUERY = BASE+2
Not a SELECT query, can't be parsed.

NOT_UPDATEABLE

  public static final int NOT_UPDATEABLE = BASE+37
The DataSet has no unique row identifiers and is not updatable.

NO_CALC_FIELDS

  public static final int NO_CALC_FIELDS = BASE+44
Operation failed. There is a CalcFieldsListener, but no Columns with the CalcType property set to CALC.

NO_NON_BLOB_COLUMNS

  public static final int NO_NON_BLOB_COLUMNS = BASE+21
Operation cannot be completed. The DataSet has no non-blob Columns.

NO_RESULT_SET

  public static final int NO_RESULT_SET = BASE+78
Execution of query did not return a result set.

NO_ROWS_AFFECTED

  public static final int NO_ROWS_AFFECTED = BASE+51
No row was affected by resolution query (either DELETE or UPDATE query).

NO_UPDATABLE_COLUMNS

  public static final int NO_UPDATABLE_COLUMNS = BASE+8
Could not find any updatable columns when saving DataSet data.

NO_WHERE_CLAUSE

  public static final int NO_WHERE_CLAUSE = BASE+40
A QueryDataSet that uses delayed detail fetching must have a where clause in its query property.

NULL_COLUMN_NAME

  public static final int NULL_COLUMN_NAME = BASE+68
Trying to perform an operation that requires a column name without having specified one.

ONEPASS_INPUT_STREAM

  public static final int ONEPASS_INPUT_STREAM = BASE+72
Attempting to read twice from a input stream that doesn't support reset().

PARAMETER_COUNT_MISMATCH

  public static final int PARAMETER_COUNT_MISMATCH = BASE+6
Mismatch between number of parameters markers in query and number of parameters in the ReadRow.

PARTIAL_SEARCH_FOR_STRING

  public static final int PARTIAL_SEARCH_FOR_STRING = BASE+23
Partial search option can only be used when last column searched on is of String type.

QUERY_FAILED

  public static final int QUERY_FAILED = BASE+62
Execution of query failed.

QUERY_IN_PROCESS

  public static final int QUERY_IN_PROCESS = BASE+26
A query is already in process for this DataSet.

QUERY_NOT_EXECUTED

  public static final int QUERY_NOT_EXECUTED = BASE+25
The query has not been executed yet

REFRESHROW_NOT_SUPPORTED

  public static final int REFRESHROW_NOT_SUPPORTED = BASE+75
The current DataSet does not support a refetch row operation.

REOPEN_FAILURE

  public static final int REOPEN_FAILURE = BASE+61
Failure notification to dependent components of a DataSet reopen.

RESOLVE_FAILED

  public static final int RESOLVE_FAILED = BASE+63
Resolve failed.

RESOLVE_IN_PROGRESS

  public static final int RESOLVE_IN_PROGRESS = BASE+69
The DataSet changes are currently being saved. Retry operation later.

RESTRUCTURE_IN_PROGRESS

  public static final int RESTRUCTURE_IN_PROGRESS = BASE+27
Operation failed. A restructure operation is already in progress.

SET_CALCULATED_FAILURE

  public static final int SET_CALCULATED_FAILURE = BASE+15
Cannot set the calculated property for Columns that already have data.

SQL_ERROR

  public static final int SQL_ERROR = BASE+66
SQLException from JDBC API.

TRANSACTION_ISOLATION_LEVEL_NOT_SUPPORTED

  public static final int TRANSACTION_ISOLATION_LEVEL_NOT_SUPPORTED = BASE+22
Driver does not support this (or any higher) transaction isolation level.

UNEXPECTED_END_OF_QUERY

  public static final int UNEXPECTED_END_OF_QUERY = BASE+3
Unexpected end of query, can't be parsed.

UNKNOWN_COLUMN_NAME

  public static final int UNKNOWN_COLUMN_NAME = BASE+10
Cannot find Column with given columnName.

UNKNOWN_PARAM_NAME

  public static final int UNKNOWN_PARAM_NAME = BASE+4
No matching named query parameter could be found.

UNRECOGNIZED_DATA_TYPE

  public static final int UNRECOGNIZED_DATA_TYPE = BASE+16
Unknown Variant data type.

errorCode

  protected int errorCode

exceptionChain

  protected ExceptionChain exceptionChain

DataSetException constructors

DataSetException(int, java.lang.String)

  public DataSetException(int errorCode, java.lang.String message)
Creates a DataSetException object with a single error.

Parameters:

errorCode
The error code generated.
message
The text message associated with the error code.

DataSetException(int, java.lang.String, borland.jbcl.util.ExceptionChain)

  public DataSetException(int errorCode, java.lang.String message, borland.jbcl.util.ExceptionChain chain)
Creates a DataSetException object with properties as specified in its parameters.

Parameters:

errorCode
The error code generated.
message
The text message associated with the error code.
chain
The ExceptionChain object that contains the linked list of generated Exception objects.

DataSetException(int, java.lang.String, java.lang.Exception)

  public DataSetException(int errorCode, java.lang.String message, java.lang.Exception ex)

Parameters:

errorCode
The error code generated.
message
The text message associated with the error code.
ex
The Exception object that contains the generated Exception.

DataSetException properties

errorCode

 public int getErrorCode()
Read-only property that returns the error code associated with the DataSetException.

exceptionChain

 public ExceptionChain getExceptionChain()
Read-only property that returns a chained Exception through a borland.jbcl.util.ExceptionChain object. The chained exception (a singly linked list) includes non-DataSetExceptions that were encountered at a lower level API.

DataSetException methods

addExceptionListener(borland.jbcl.dataset.ExceptionListener)

  public static final void addExceptionListener(borland.jbcl.dataset.ExceptionListener listener)
Add a listener for ExceptionListener dispatches.

handleException(borland.jbcl.dataset.DataSet, java.awt.Component, java.lang.Exception)

  public static final void handleException(borland.jbcl.dataset.DataSet dataSet, java.awt.Component component, java.lang.Exception ex)

handleException(borland.jbcl.dataset.DataSet, java.awt.Component, java.lang.Exception, boolean)

  public static final void handleException(borland.jbcl.dataset.DataSet dataSet, java.awt.Component component, java.lang.Exception ex, boolean modal)

handleException(java.lang.Exception)

  public static final void handleException(java.lang.Exception ex)

handleException(java.lang.Exception, boolean)

  public static final void handleException(java.lang.Exception ex, boolean modal)

printStackTrace()

  public void printStackTrace()

Overrides: java.lang.Throwable.printStackTrace()

printStackTrace(java.io.PrintStream)

  public void printStackTrace(java.io.PrintStream out)

Overrides: java.lang.Throwable.printStackTrace(java.io.PrintStream)

removeExceptionListener(borland.jbcl.dataset.ExceptionListener)

  public static final void removeExceptionListener(borland.jbcl.dataset.ExceptionListener listener)
Add a listener for ExceptionListener dispatches.

throwBadQueryProperties()

  public static final void throwBadQueryProperties()

throwIOException(java.io.IOException)

  public static final void throwIOException(java.io.IOException ex)

throwInvalidColumnType(int)

  public static final void throwInvalidColumnType(int dataType)

throwQueryInProcess()

  public static final void throwQueryInProcess()

throwQueryNotExecuted()

  public static final void throwQueryNotExecuted()

throwSQLException(java.sql.SQLException)

  public static final void throwSQLException(java.sql.SQLException ex)