net.sf.farrago.jdbc
Class FarragoJdbcUtil.FarragoSqlException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.sql.SQLException
              extended by net.sf.farrago.jdbc.FarragoJdbcUtil.FarragoSqlException
All Implemented Interfaces:
Serializable
Enclosing class:
FarragoJdbcUtil

public static class FarragoJdbcUtil.FarragoSqlException
extends SQLException

Exception thrown by Farrago JDBC driver.

The exception contains the original, undiluted exception for more detailed diagnostics. This is used by the testing infrastructure to ensure that the error occurs at the right (line, col) thru (line, col) position.

The original exception is returned by the getOriginalThrowable() method, but will not be returned from the standard SQLException.getNextException() or Throwable.getCause() methods; this exception therefore behaves exactly like a regular SQLException.

See Also:
Serialized Form

Field Summary
private  Throwable original
          Original exception.
private  String originalStatement
           
private static long serialVersionUID
          SerialVersionUID created with JDK 1.5 serialver tool.
 
Constructor Summary
FarragoJdbcUtil.FarragoSqlException(String reason, Throwable original, String originalStatement, Throwable cause)
          Creates an exception with a message and a record of the undiluted original exception.
 
Method Summary
 String getOriginalStatement()
          Returns the original statement.
 Throwable getOriginalThrowable()
          Returns the original exception.
private  Object writeReplace()
          Per Serializable API, provides a replacement object to be written during serialization.
 
Methods inherited from class java.sql.SQLException
getErrorCode, getNextException, getSQLState, setNextException
 
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
 

Field Detail

serialVersionUID

private static final long serialVersionUID
SerialVersionUID created with JDK 1.5 serialver tool.

See Also:
Constant Field Values

original

private final Throwable original
Original exception.


originalStatement

private final String originalStatement
Constructor Detail

FarragoJdbcUtil.FarragoSqlException

public FarragoJdbcUtil.FarragoSqlException(String reason,
                                           Throwable original,
                                           String originalStatement,
                                           Throwable cause)
Creates an exception with a message and a record of the undiluted original exception.

Parameters:
reason - A description of the exception
original - Original exception
originalStatement - Original statement
Method Detail

getOriginalThrowable

public Throwable getOriginalThrowable()
Returns the original exception.

Returns:
original exception

getOriginalStatement

public String getOriginalStatement()
Returns the original statement.

Returns:
original statement

writeReplace

private Object writeReplace()
Per Serializable API, provides a replacement object to be written during serialization.

This implementation converts this FarragoSqlException into an exception that looks similar but is serializable.