org.jminor.common.db.exception
Class DatabaseException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.jminor.common.db.exception.DatabaseException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
RecordModifiedException, RecordNotFoundException

public class DatabaseException
extends Exception

An exception coming from a database-layer.

See Also:
Serialized Form

Constructor Summary
DatabaseException(SQLException cause, String statement, String message)
          Constructs a new DatabaseException instance
DatabaseException(String message)
          Constructs a new DatabaseException instance
DatabaseException(String message, String statement)
          Constructs a new DatabaseException instance
 
Method Summary
 String getStatement()
           
 
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
 

Constructor Detail

DatabaseException

public DatabaseException(String message)
Constructs a new DatabaseException instance

Parameters:
message - the exception message

DatabaseException

public DatabaseException(String message,
                         String statement)
Constructs a new DatabaseException instance

Parameters:
message - the exception message
statement - the sql statement which caused the exception

DatabaseException

public DatabaseException(SQLException cause,
                         String statement,
                         String message)
Constructs a new DatabaseException instance

Parameters:
cause - the cause of the exception
statement - the sql statement which caused the exception
message - the exception message
Method Detail

getStatement

public final String getStatement()
Returns:
the sql query which caused the exception