org.objectweb.cjdbc.common.exceptions.driver
Class DriverSQLException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.sql.SQLException
              extended byorg.objectweb.cjdbc.common.exceptions.driver.DriverSQLException
All Implemented Interfaces:
java.io.Serializable

public class DriverSQLException
extends java.sql.SQLException

FIXME: this class relies on "multiple dispatch", which does not exist in Java (doh!). The current workaround it to cast properly at each call site. The definitive fix is to use instanceof.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.sql.SQLException
 
Fields inherited from class java.lang.Exception
 
Fields inherited from class java.lang.Throwable
 
Constructor Summary
DriverSQLException()
           
DriverSQLException(java.lang.Exception cause)
          Missing message constructor: let's borrow message from cause.
DriverSQLException(SerializableException cause)
          Missing message constructor: let's borrow message from cause.
DriverSQLException(java.sql.SQLException cause)
          Deprecated.  
DriverSQLException(java.lang.String reason)
           
DriverSQLException(java.lang.String message, java.lang.Exception cause)
          Creates a new DriverSQLException around an exception of a type not specifically handled elsewhere.
DriverSQLException(java.lang.String message, SerializableException cause)
          Creates a new DriverSQLException around a SerializableException received from controller, itself converted from an SQLException in most cases.
DriverSQLException(java.lang.String message, java.sql.SQLException cause)
          Deprecated.  
DriverSQLException(java.lang.String reason, java.lang.String sQLState)
           
DriverSQLException(java.lang.String reason, java.lang.String sQLState, int vendorCode)
           
 
Method Summary
 void printStackTrace()
          Overrides super method so we print the serializable stack trace of next exceptions in the chain (if they use our serializable stack trace)
 void printStackTrace(java.io.PrintStream s)
          Overrides super method so we print the serializable stack trace of next exceptions in the chain (if they use our serializable stack trace)
 void printStackTrace(java.io.PrintWriter s)
          Overrides super method so we print the serializable stack trace of next exceptions in the chain (if they use our serializable stack trace)
 
Methods inherited from class java.sql.SQLException
getErrorCode, getNextException, getSQLState, setNextException
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DriverSQLException

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

DriverSQLException

public DriverSQLException(java.lang.String reason)
See Also:
SQLException.SQLException(java.lang.String)

DriverSQLException

public DriverSQLException(java.lang.String reason,
                          java.lang.String sQLState)
See Also:
SQLException.SQLException(java.lang.String, java.lang.String)

DriverSQLException

public DriverSQLException(java.lang.String reason,
                          java.lang.String sQLState,
                          int vendorCode)
See Also:
SQLException.SQLException(java.lang.String, java.lang.String, int)

DriverSQLException

public DriverSQLException(java.lang.String message,
                          SerializableException cause)
Creates a new DriverSQLException around a SerializableException received from controller, itself converted from an SQLException in most cases. So we set SQLState and vendorCode.

Parameters:
message - message
cause - exception from controller to wrap

DriverSQLException

public DriverSQLException(SerializableException cause)
Missing message constructor: let's borrow message from cause.

Parameters:
cause - exception to wrap

DriverSQLException

public DriverSQLException(java.lang.Exception cause)
Missing message constructor: let's borrow message from cause.

Parameters:
cause - exception to wrap

DriverSQLException

public DriverSQLException(java.lang.String message,
                          java.lang.Exception cause)
Creates a new DriverSQLException around an exception of a type not specifically handled elsewhere. Typically used for exceptions internal to the driver.

Parameters:
message - message
cause - generic exception to wrap

DriverSQLException

public DriverSQLException(java.sql.SQLException cause)
Deprecated.  

See Also:
DriverSQLException(String, SQLException)

DriverSQLException

public DriverSQLException(java.lang.String message,
                          java.sql.SQLException cause)
                   throws java.lang.IllegalArgumentException
Deprecated.  

An SQLException should not be wrapped inside a DriverSQLException: this is a symptom of mixing different layers.

Parameters:
message - message
cause - cause
Throws:
java.lang.IllegalArgumentException - always
Method Detail

printStackTrace

public void printStackTrace(java.io.PrintStream s)
Overrides super method so we print the serializable stack trace of next exceptions in the chain (if they use our serializable stack trace)

See Also:
Throwable.printStackTrace(java.io.PrintStream)

printStackTrace

public void printStackTrace()
Overrides super method so we print the serializable stack trace of next exceptions in the chain (if they use our serializable stack trace)

See Also:
Throwable.printStackTrace()

printStackTrace

public void printStackTrace(java.io.PrintWriter s)
Overrides super method so we print the serializable stack trace of next exceptions in the chain (if they use our serializable stack trace)

See Also:
Throwable.printStackTrace(java.io.PrintWriter)


Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.