|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.softtech.jdbc.DatabaseException
public abstract class DatabaseException
DatabaseException denotes a generic runtime data access (SQL) exception. By declaring the exception as a descendant of RuntimeException, the jdbc framework give the programmer the option of whether or not to catch the exception.
| Field Summary | |
|---|---|
protected int |
sqlErrorCode
sql error code obtained from database after exception |
protected java.lang.String |
SQLState
sql state obtained from database after exception |
| Constructor Summary | |
|---|---|
DatabaseException(java.lang.String msg)
constructor initializes the sqlErrorCode to -1 and the SQLState to null |
|
DatabaseException(java.lang.String msg,
java.sql.SQLException e)
constructor initializes the sqlErrorCode |
|
| Method Summary | |
|---|---|
int |
getSQLErrorCode()
Get the SQLErrorCode |
java.lang.String |
getSQLState()
get the SQLState |
abstract boolean |
isBadSQLGrammar()
was db exception caused by bad sql grammer (a typo)? |
abstract boolean |
isDatabaseUnavailable()
was db exception caused by database being unavailable? |
abstract boolean |
isDataIntegrityViolation()
was db exception caused by a data integrity violation? |
abstract boolean |
isInvalidBindVariableName()
was db exception caused by referencing a invalid bind parameter name? |
abstract boolean |
isNonExistentTableOrViewOrCol()
was db exception caused by referencing a non existent table or view? |
abstract boolean |
isRowlockOrTimedOut()
was db exception caused by a row lock error or some other sql querty timeout? |
abstract boolean |
isUniqueConstraintViolation()
was db exception caused by unique constraint violation (duplicate record) |
abstract boolean |
isVarParameterUnbound()
was db exception caused by a an unbound variable (parameter)? |
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int sqlErrorCode
protected java.lang.String SQLState
| Constructor Detail |
|---|
public DatabaseException(java.lang.String msg,
java.sql.SQLException e)
msg - error messagee - corresponding SQLExceptionpublic DatabaseException(java.lang.String msg)
s - | Method Detail |
|---|
public abstract boolean isDataIntegrityViolation()
public abstract boolean isUniqueConstraintViolation()
public abstract boolean isBadSQLGrammar()
public abstract boolean isNonExistentTableOrViewOrCol()
public abstract boolean isInvalidBindVariableName()
public abstract boolean isDatabaseUnavailable()
public abstract boolean isRowlockOrTimedOut()
public abstract boolean isVarParameterUnbound()
public int getSQLErrorCode()
public java.lang.String getSQLState()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||