org.apache.derby.impl.jdbc
Class SQLExceptionFactory40

java.lang.Object
  extended by org.apache.derby.impl.jdbc.SQLExceptionFactory
      extended by org.apache.derby.impl.jdbc.SQLExceptionFactory40

public class SQLExceptionFactory40
extends SQLExceptionFactory

SQLExceptionFactory40 overwrites getSQLException method to return SQLException or one of its sub class


Constructor Summary
SQLExceptionFactory40()
           
 
Method Summary
 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)
          overwrites super class method to create JDBC4 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 Note the following divergence from JDBC3 behavior: When running a JDBC3 client, we return EmbedSQLException.
private  java.sql.SQLException wrapArgsForTransportAcrossDRDA(java.lang.String message, java.lang.String messageId, java.sql.SQLException next, int severity, java.lang.Throwable t, java.lang.Object[] args)
           The following method helps handle DERBY-1178.
 
Methods inherited from class org.apache.derby.impl.jdbc.SQLExceptionFactory
getArgumentFerry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLExceptionFactory40

public SQLExceptionFactory40()
Method Detail

getSQLException

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)
overwrites super class method to create JDBC4 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 Note the following divergence from JDBC3 behavior: When running a JDBC3 client, we return EmbedSQLException. That exception class overrides Throwable.toString() and strips off the Throwable's class name. In contrast, the following JDBC4 implementation returns subclasses of java.sql.Exception. These subclasses inherit the behavior of Throwable.toString(). That is, their toString() output includes their class name. This will break code which relies on the stripping behavior of EmbedSQLSxception.toString().

Overrides:
getSQLException in class SQLExceptionFactory

wrapArgsForTransportAcrossDRDA

private java.sql.SQLException wrapArgsForTransportAcrossDRDA(java.lang.String message,
                                                             java.lang.String messageId,
                                                             java.sql.SQLException next,
                                                             int severity,
                                                             java.lang.Throwable t,
                                                             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 EmbedSQLException which preserves that information. We return the dummy exception.


Built on Thu 2011-03-10 11:54:14+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.