Class 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, Armen Rizal, GOODWILL CONSULTING FR [2789943] Better DBException handling for PostgreSQL https://sourceforge.net/p/adempiere/feature-requests/719/
    See Also:
    Serialized Form
    • Constructor Detail

      • DBException

        public DBException​(Exception e)
        Create a new DBException based on a SQLException
        Parameters:
        e - Specicy the Exception cause
      • DBException

        public DBException​(SQLException e,
                           String sql)
        Create a new DBException based on a SQLException and SQL Query
        Parameters:
        e - exception
        sql - sql query
      • DBException

        public DBException​(String msg)
        Create a new DBException
        Parameters:
        msg - Message
    • Method Detail

      • getSQL

        public String getSQL()
        Returns:
        SQL Query or null
      • getSQLException

        public SQLException getSQLException()
        Returns:
        Wrapped SQLException or null
      • 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
      • isTimeout

        public static boolean isTimeout​(Exception e)
        Check if "time out" exception (aka ORA-01013)
        Parameters:
        e -
      • isValueTooLarge

        public static boolean isValueTooLarge​(Exception e)
        Check if value too large for column exception (aka ORA-12899)
        Parameters:
        e - exception
      • getDefaultDBExceptionMessage

        public static String getDefaultDBExceptionMessage​(Exception e)
        Parameters:
        e -