Package org.adempiere.exceptions
Class DBException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.adempiere.exceptions.AdempiereException
org.adempiere.exceptions.DBException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
DBException
This RuntimeException is used to pass SQLException up the chain of calling
methods to determine what to do where needed.
- Version:
- $Id: DBException.java,v 1.2 2006/07/30 00:54:35 jjanke Exp $
- Author:
- Vincent Harcq, Teo Sarca, SC ARHIPAC SERVICE SRL, Armen Rizal, GOODWILL CONSULTING FR [2789943] Better DBException handling for PostgreSQL https://sourceforge.net/p/adempiere/feature-requests/719/
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreate a new DBException based on a SQLExceptionDBException
(String msg) Create a new DBExceptionDBException
(String msg, Exception e) Create a new DBExceptionDBException
(SQLException e, String sql) Create a new DBException based on a SQLException and SQL Query -
Method Summary
Modifier and TypeMethodDescriptionstatic String
int
getSQL()
static boolean
Check if "child record found" exception (aka ORA-02292)static boolean
Check if "invalid identifier" exception (aka ORA-00904)static boolean
Check if "invalid username/password" exception (aka ORA-01017).
Only implemented for Oracle.static boolean
Check if "time out" exception (aka ORA-01013)static boolean
Check if Unique Constraint Exception (aka ORA-00001)static boolean
Check if value too large for column exception (aka ORA-12899)Methods inherited from class org.adempiere.exceptions.AdempiereException
getCtx, getLocalizedMessage
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
DATABASE_OPERATION_TIMEOUT_MSG
- See Also:
-
DELETE_ERROR_DEPENDENT_MSG
- See Also:
-
DELETE_ERROR_DEPENDENT_MSG_WITH_INFO
- See Also:
-
SAVE_ERROR_NOT_UNIQUE_MSG
- See Also:
-
-
Constructor Details
-
DBException
Create a new DBException based on a SQLException- Parameters:
e
- Specify the Exception cause
-
DBException
Create a new DBException based on a SQLException and SQL Query- Parameters:
e
- exceptionsql
- sql query
-
DBException
Create a new DBException- Parameters:
msg
- Message
-
DBException
Create a new DBException- Parameters:
msg
- Messagee
- Exception
-
-
Method Details
-
getSQL
- Returns:
- SQL Query or null
-
getSQLException
- Returns:
- Wrapped SQLException or null
-
getErrorCode
public int getErrorCode()- See Also:
-
getNextException
- See Also:
-
getSQLState
- See Also:
-
isUniqueContraintError
Check if Unique Constraint Exception (aka ORA-00001)- Parameters:
e
- exception- Returns:
- true if e is unique constraint exception
-
isChildRecordFoundError
Check if "child record found" exception (aka ORA-02292)- Parameters:
e
- exception- Returns:
- true if e is child record found exception (typically for delete)
-
isInvalidIdentifierError
Check if "invalid identifier" exception (aka ORA-00904)- Parameters:
e
- exception- Returns:
- true if e is invalid identifier exception
-
isInvalidUserPassError
Check if "invalid username/password" exception (aka ORA-01017).
Only implemented for Oracle.- Parameters:
e
- exception- Returns:
- true if e is invalid user/password exception
-
isTimeout
Check if "time out" exception (aka ORA-01013)- Parameters:
e
-- Returns:
- true if e is time out exception
-
isValueTooLarge
Check if value too large for column exception (aka ORA-12899)- Parameters:
e
- exception- Returns:
- true if e is value too large for column exception
-
getDefaultDBExceptionMessage
- Parameters:
e
-- Returns:
- default AD message for exception or null
-