borland Packages  Class Hierarchy  dbswing Package 

DBExceptionHandler component

java.lang.Object
   +----com.borland.dbswing.DBExceptionHandler

About the DBExceptionHandler component

Constructors  Properties  Methods  

Implements Designable, Serializable

Note: This is a feature of JBuilder Professional and Enterprise.

The DBExceptionHandler component is the dbSwing package's default DataSetException handler. It displays an error dialog (DBExceptionDialog) when a DataSetException is thrown. See DBExceptionDialog for descriptions of properties that can be set to configure the capabilities of the error dialog.

If the exception thrown is of type ValidationException (a subclass of DataSetException), the error dialog appears only if there are no StatusEvent listeners on the DataSet. An example of this is the JdbStatusLabel component. A ValidationException is usually generated by a constraint violation, such as a value entered outside the range of allowable minimum or maximum values.

To programmatically suppress this dialog at run time, set the displayErrors property of the DataSet to false.

Example:

DBExceptionHandler handler = DBException.getInstance();
try {
<some code which could cause a DataSetException>  
}
catch (DataSetException exception) {
handler.handleException(dataSet, frame, exception);
}

DBExceptionHandler constructors

DBExceptionHandler properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.lang.Object

DBExceptionHandler methods

Methods implemented in this class

Methods implemented in java.lang.Object


DBExceptionHandler constructors

DBExceptionHandler()

  public DBExceptionHandler()
Constructs a DBExceptionHandler.

DBExceptionHandler properties

allowExit

 public boolean isAllowExit()
 public void setAllowExit(boolean allowExit)
Returns and sets whether an Exit button is displayed when an Exception occurs.

closeConnectionsOnExit

 public boolean isCloseConnectionsOnExit()
 public void setCloseConnectionsOnExit(boolean closeConnections)
Returns and sets whether any open database connections should be closed when the Exit button is used to terminate an application. This property is true by default.

closeDataStoresOnExit

 public boolean isCloseDataStoresOnExit()
 public void setCloseDataStoresOnExit(boolean closeDataStores)
Returns and sets whether DataStores are automatically detected and closed when the Exit button is used to terminate an application. The default value is true.

displayChainedExceptions

 public boolean isDisplayChainedExceptions()
 public void setDisplayChainedExceptions(boolean displayChains)
Returns and sets whether the Next or Previous buttons appear when a ChainedException occurs. For non-chained exceptions, this property has no effect. This property value is true by default.

displayStackTraces

 public boolean isDisplayStackTraces()
 public void setDisplayStackTraces(boolean displayStack)
Returns and sets whether the Stack Trace toggle button appears when an Exception occurs. When it is selected, an exception message is displayed along with its stack trace. This property value is true by default.

enableSecretDebugKey

 public boolean isEnableSecretDebugKey()
 public void setEnableSecretDebugKey(boolean enableSecretKey)
Returns and sets whether the Ctrl-Alt-Shift-D key combination can be used to unconditionally force the display of all buttons when the dialog box is visible. This property value is true by default.

DBExceptionHandler methods

getInstance()

  public static DBExceptionHandler getInstance()
Returns a single instance of DBExceptionHandler. Properties set on the instance returned by this method are applied to all the DBExceptionDialogs that are subsequently displayed.

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

  public static final void handleException(DataSet dataSet, Component component, Exception ex)
Calls handleException(com.borland.dx.dataset.DataSet, java.awt.Component, java.lang.Throwable, boolean) and passes to it the dataSet, component, and ex parameter values. It also passes false as the value of the modal parameter.

Parameters:

dataSet
The DataSet the exception occurs in if the exception is a DataSet exception.
component
The component on which the exception occurred.
ex
The Exception that occurs.

handleException(com.borland.dx.dataset.DataSet, java.awt.Component, java.lang.Throwable, boolean)

  public static final void handleException(DataSet dataSet, Component component, Throwable ex, boolean modal)
This method processes the exception as appropriate.

Parameters:

dataSet
The DataSet the exception occurs in if the exception is a DataSet exception.
component
The component on which the exception occurred.
ex
The Exception that occurs.
modal
Whether the DBExceptionDialog is modal or not. A modal dialog must be dismissed before using the rest of the program.

handleException(com.borland.dx.dataset.DataSet, java.lang.Exception)

  public static final void handleException(DataSet dataSet, Exception ex)
Calls the handleException(com.borland.dx.dataset.DataSet, java.awt.Component, java.lang.Throwable, boolean) method and passes the dataSet and the ex parameter values. It passes a null value for the component parameter and passes false as the value of the modal parameter.

Parameters:

dataSet
The DataSet the exception occurs in if the exception is a DataSet exception.
ex
The Exception that occurs.

handleException(java.lang.Exception)

  public static final void handleException(Exception ex)
Calls the handleException(com.borland.dx.dataset.DataSet, java.awt.Component, java.lang.Throwable, boolean) method and passes the exception and null values for the dataSet, component and modal parameters.

Parameters:

ex
The Exception that occurs.