Adempiere 3.5.2a

org.adempiere.exceptions
Class DBException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.adempiere.exceptions.AdempiereException
                  extended by org.adempiere.exceptions.DBException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DBException

public class DBException
extends AdempiereException

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
See Also:
Serialized Form

Constructor Summary
DBException(Exception e)
          Create a new DBException based on a SQLException
DBException(String msg)
          Create a new DBException
 
Method Summary
 int getErrorCode()
           
 SQLException getNextException()
           
 SQLException getSQLException()
           
 String getSQLState()
           
static boolean isChildRecordFoundError(Exception e)
          Check if "child record found" exception (aka ORA-02292)
static boolean isInvalidIdentifierError(Exception e)
          Check if "invalid identifier" exception (aka ORA-00904)
static boolean isInvalidUserPassError(Exception e)
          Check if "invalid username/password" exception (aka ORA-01017)
static boolean isUniqueContraintError(Exception e)
          Check if Unique Constraint Exception (aka ORA-00001)
 
Methods inherited from class org.adempiere.exceptions.AdempiereException
getCtx, getLocalizedMessage
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, 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
 

Constructor Detail

DBException

public DBException(Exception e)
Create a new DBException based on a SQLException

Parameters:
e - Specicy the Exception cause

DBException

public DBException(String msg)
Create a new DBException

Parameters:
msg - Message
Method Detail

getSQLException

public SQLException getSQLException()
Returns:
Wrapped SQLException or null

getErrorCode

public int getErrorCode()
See Also:
SQLException.getErrorCode()

getNextException

public SQLException getNextException()
See Also:
SQLException.getNextException()

getSQLState

public String getSQLState()
See Also:
SQLException.getSQLState()

isUniqueContraintError

public static boolean isUniqueContraintError(Exception e)
Check if Unique Constraint Exception (aka ORA-00001)

Parameters:
e - exception

isChildRecordFoundError

public static boolean isChildRecordFoundError(Exception e)
Check if "child record found" exception (aka ORA-02292)

Parameters:
e - exception

isInvalidIdentifierError

public static boolean isInvalidIdentifierError(Exception e)
Check if "invalid identifier" exception (aka ORA-00904)

Parameters:
e - exception

isInvalidUserPassError

public static boolean isInvalidUserPassError(Exception e)
Check if "invalid username/password" exception (aka ORA-01017)

Parameters:
e - exception

Adempiere 3.5.2a

Adempiere® is a registered trademark of ADempiere Business Inc. ©2004-2008 HumanFlash.com All rights reserved.