quick.dbtable
Interface DBTableErrorListener


public interface DBTableErrorListener


Field Summary
static int BOUND_ERROR
           
static int CELL_EMPTY
           
static int DELETE_ERROR
           
static int DRIVER_NOT_FOUND
           
static int FETCH_ERROR
           
static int INSERT_ERROR
           
static int SORT_NOT_SUPPORTED
           
static int UNKNOWN_ERROR
           
static int UPDATE_ERROR
           
 
Method Summary
 boolean errorOccured(int errorId, java.lang.String errorMessage, java.lang.Exception unexpectedException)
          This function is called whenever an error occured or an exception is caught by DBTable.
 

Field Detail

CELL_EMPTY

public static final int CELL_EMPTY
See Also:
Constant Field Values

DRIVER_NOT_FOUND

public static final int DRIVER_NOT_FOUND
See Also:
Constant Field Values

UPDATE_ERROR

public static final int UPDATE_ERROR
See Also:
Constant Field Values

UNKNOWN_ERROR

public static final int UNKNOWN_ERROR
See Also:
Constant Field Values

INSERT_ERROR

public static final int INSERT_ERROR
See Also:
Constant Field Values

DELETE_ERROR

public static final int DELETE_ERROR
See Also:
Constant Field Values

BOUND_ERROR

public static final int BOUND_ERROR
See Also:
Constant Field Values

FETCH_ERROR

public static final int FETCH_ERROR
See Also:
Constant Field Values

SORT_NOT_SUPPORTED

public static final int SORT_NOT_SUPPORTED
See Also:
Constant Field Values
Method Detail

errorOccured

public boolean errorOccured(int errorId,
                            java.lang.String errorMessage,
                            java.lang.Exception unexpectedException)
This function is called whenever an error occured or an exception is caught by DBTable.
 If it is an error generated by DBTable , then error id will have a value not equal to zero
 If it is an unexpected exception, the errorId will have a value zero, the caught exception
 will be in the unexpectedException argument

 Following are the valid error id & the error message displayed & the reason for the error

 1 - This cell can't be empty - When user empties out a non null column cell
 2 - Unable to find the Database Driver! - JDBC driver not found
 3 - Unable to Update! - When a record is updated
 4 - UnKnown Exception
 5 - Unable to insert! - When a new record is inserted
 6 - Unable to delete! - when a record is deleted
 7 - Error in boundSql! - When there is an error in boundSql for a column
 8 - Database error - When fetching records from the database
 9 - Sorting not supported for your database! - when table header is clicked
 25 - During replaceAll, after replacing errorOccured will be called with errorMessage={number of replacements}, unexpectedException=null
      You can use this to show your own messages
 

Parameters:
errorId - non zero if an error generated by DBtable
errorMessage -
unexpectedException - the actual exception thrown. This will be null is error generated by DBtable
Returns:
if the error is handled return true, if you want DBtable to handle the error retun false