Arch4J 1.1

org.arch4j.dataaccess
Class DataAccessException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--org.arch4j.core.BaseApplicationException
                    |
                    +--org.arch4j.dataaccess.DataAccessException
All Implemented Interfaces:
BaseException, Serializable
Direct Known Subclasses:
ConcurrencyException

public class DataAccessException
extends BaseApplicationException

This class is a wrapper for SQLExceptions. It adds an additional constructor that takes a SQLException, generates an informative message string, and holds onto the original exception.

The method that generates the informative message is available for any caller with a SQLException, via the static getErrorString(SQLException) method.

Version:
1.0
Author:
Ross E. Greinke
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.arch4j.core.BaseApplicationException
nestedException
 
Constructor Summary
DataAccessException()
          Constructs a DataAccessException with no specified detail message or nested exception.
DataAccessException(SQLException exception)
          Constructs a DataAccessException with the specified nested SQL exception.
DataAccessException(String message)
          Constructs a DataAccessException with the specified detail message.
DataAccessException(String message, Throwable exception)
          Constructs a DataAccessException with the specified detail message and nested exception.
DataAccessException(Throwable exception)
          Constructs a DataAccessException with the specified nested exception.
 
Method Summary
static String getErrorString(SQLException ex)
          Creates an informative error string based on the given SQLException, following the chain of additional exceptions (if any).
 
Methods inherited from class org.arch4j.core.BaseApplicationException
getMessage, getNestedException, getStackTraceString, printStackTrace, printStackTrace, printStackTrace
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataAccessException

public DataAccessException()
Constructs a DataAccessException with no specified detail message or nested exception.


DataAccessException

public DataAccessException(String message)
Constructs a DataAccessException with the specified detail message.

Parameters:
message - The detailed message.

DataAccessException

public DataAccessException(Throwable exception)
Constructs a DataAccessException with the specified nested exception.

Parameters:
exception - The nested exception.

DataAccessException

public DataAccessException(SQLException exception)
Constructs a DataAccessException with the specified nested SQL exception. An informative error string is automatically constructed.

Parameters:
exception - The nested SQL exception.
See Also:
getErrorString(SQLException)

DataAccessException

public DataAccessException(String message,
                           Throwable exception)
Constructs a DataAccessException with the specified detail message and nested exception.

Parameters:
message - The detailed message.
exception - The nested exception.
Method Detail

getErrorString

public static String getErrorString(SQLException ex)
Creates an informative error string based on the given SQLException, following the chain of additional exceptions (if any).

Parameters:
ex - The original SQLException.
Returns:
A String containing the exception's error information.

Arch4J 1.1

Copyright © 2000-2004 SpiderLogic, a service of Wipfli Ullrich Bertelson LLP.