public class SQLExceptionFactory extends ExceptionFactory
Constructor and Description |
---|
SQLExceptionFactory() |
Modifier and Type | Method and Description |
---|---|
java.sql.SQLException |
getSQLException(java.lang.String messageId,
java.sql.SQLException next,
java.lang.Throwable cause,
java.lang.Object... args)
Construct an SQLException whose message and severity are derived from
the message id.
|
java.sql.SQLException |
getSQLException(java.lang.String message,
java.lang.String messageId,
java.sql.SQLException next,
int severity,
java.lang.Throwable t,
java.lang.Object... args)
method to construct SQLException
version specific drivers can overload this method to create
version specific exceptions
This implementation creates JDBC 4 exceptions.
|
private StandardException |
wrapArgsForTransportAcrossDRDA(java.lang.String messageId,
java.lang.Throwable cause,
java.lang.Object[] args)
The following method helps handle DERBY-1178.
|
getInstance
public java.sql.SQLException getSQLException(java.lang.String message, java.lang.String messageId, java.sql.SQLException next, int severity, java.lang.Throwable t, java.lang.Object... args)
method to construct SQLException version specific drivers can overload this method to create version specific exceptions
This implementation creates JDBC 4 exceptions.
SQLSTATE CLASS (prefix) Exception 0A java.sql.SQLFeatureNotSupportedException 08 java.sql.SQLNonTransientConnectionException 22 java.sql.SQLDataException 28 java.sql.SQLInvalidAuthorizationSpecException 40 java.sql.SQLTransactionRollbackException 42 java.sql.SQLSyntaxErrorException
getSQLException
in class ExceptionFactory
message
- the exception messagemessageId
- the message idnext
- the next SQLExceptionseverity
- the severity of the exceptiont
- the cause of the exceptionargs
- the message argumentspublic final java.sql.SQLException getSQLException(java.lang.String messageId, java.sql.SQLException next, java.lang.Throwable cause, java.lang.Object... args)
getSQLException
in class ExceptionFactory
messageId
- the message idnext
- the next SQLExceptioncause
- the cause of the exceptionargs
- the message argumentsprivate StandardException wrapArgsForTransportAcrossDRDA(java.lang.String messageId, java.lang.Throwable cause, java.lang.Object[] args)
The following method helps handle DERBY-1178. The problem is that we may need to serialize our final SQLException across the DRDA network layer. That serialization involves some clever encoding of the Derby messageID and arguments. Unfortunately, once we create one of the JDBC4-specific subclasses of SQLException, we lose the messageID and args. This method creates a dummy StandardException which preserves that information, unless the cause is already a StandardException which contains the necessary information for serializing the exception.
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.