You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by ka...@apache.org on 2014/03/03 13:14:06 UTC

svn commit: r1573534 - in /db/derby/code/trunk/java: drda/org/apache/derby/impl/drda/ engine/org/apache/derby/iapi/error/ engine/org/apache/derby/impl/jdbc/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionT...

Author: kahatlen
Date: Mon Mar  3 12:14:06 2014
New Revision: 1573534

URL: http://svn.apache.org/r1573534
Log:
DERBY-6488: Remove the EmbedSQLException class and the associated DerbySQLException interface.

Removed:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/error/DerbySQLException.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedSQLException.java
Modified:
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/error/PublicAPI.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/error/StandardException.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/SQLExceptionFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/Util.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/importExportIJ.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/PreparedStatementTest.java

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java?rev=1573534&r1=1573533&r2=1573534&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java Mon Mar  3 12:14:06 2014
@@ -65,7 +65,6 @@ import org.apache.derby.shared.common.sa
 import org.apache.derby.iapi.services.stream.HeaderPrintWriter;
 import org.apache.derby.iapi.tools.i18n.LocalizedResource;
 import org.apache.derby.iapi.util.StringUtil;
-import org.apache.derby.impl.jdbc.EmbedSQLException;
 import org.apache.derby.impl.jdbc.Util;
 import org.apache.derby.jdbc.InternalDriver;
 
@@ -1357,14 +1356,14 @@ class DRDAConnThread extends Thread {
      * is not enough to check that the SQL state is 08004 and conclude
      * that authentication caused the exception to be thrown.
      *
-     * This method tries to cast the exception to an EmbedSQLException
+     * This method tries to get a StandardException from the SQLException
      * and use getMessageId on that object to check for authentication
      * error instead of the SQL state we get from
      * SQLExceptions#getSQLState. getMessageId returns the entire id
      * as defined in SQLState (e.g. 08004.C.1), while getSQLState only
      * return the 5 first characters (i.e. 08004 instead of 08004.C.1)
      *
-     * If the cast to EmbedSQLException is not successful, the
+     * If the SQLException isn't linked to a StandardException, the
      * assumption that SQL State 08004 is caused by an authentication
      * failure is followed even though this is not correct. This was
      * the pre DERBY-3060 way of solving the issue.
@@ -1379,14 +1378,14 @@ class DRDAConnThread extends Thread {
         boolean authFail = false;
 
         // get exception which carries Derby messageID and args
-        SQLException se = StandardException.getArgumentFerry(sqlException);
+        StandardException se = StandardException.getArgumentFerry(sqlException);
 
-        if (se instanceof EmbedSQLException) {
-            // DERBY-3060: if this is an EmbedSQLException, we can
+        if (se != null) {
+            // DERBY-3060: if this is a Derby exception, we can
             // check the messageId to find out what caused the
             // exception.
 
-            String msgId = ((EmbedSQLException)se).getMessageId();
+            String msgId = se.getMessageId();
 
             // Of the 08004.C.x messages, only
             // SQLState.NET_CONNECT_AUTH_FAILED is an authentication
@@ -1395,10 +1394,10 @@ class DRDAConnThread extends Thread {
                 authFail = true;
             }
         } else {
-            String sqlState = se.getSQLState();
+            String sqlState = sqlException.getSQLState();
             if (sqlState.regionMatches(0,SQLState.LOGIN_FAILED,0,5)) {
                 // Unchanged by DERBY-3060: This is not an
-                // EmbedSQLException, so we cannot check the
+                // Derby exception, so we cannot check the
                 // messageId. As before DERBY-3060, we assume that all
                 // 08004 error codes are due to an authentication
                 // failure, even though this ambigious
@@ -6447,14 +6446,16 @@ class DRDAConnThread extends Thread {
         String sqlerrmc;
 
         // get exception which carries Derby messageID and args, per DERBY-1178
-        se = StandardException.getArgumentFerry( se );
-        
-        if (se instanceof EmbedSQLException  && ! severe) {
-            sqlerrmc = buildTokenizedSqlerrmc(se);
-        } else if (se instanceof DataTruncation) {
+        StandardException ferry = StandardException.getArgumentFerry(se);
+
+        if (se instanceof DataTruncation) {
+            // Encode DataTruncation in a special way.
             sqlerrmc = buildDataTruncationSqlerrmc((DataTruncation) se);
+        } else if (ferry != null && !severe) {
+            // All other non-severe Derby exceptions are encoded here.
+            sqlerrmc = buildTokenizedSqlerrmc(se);
         } else {
-            // If this is not an EmbedSQLException or is a severe excecption where
+            // If this is not a Derby exception or is a severe excecption where
             // we have no hope of succussfully calling the SYSIBM.SQLCAMESSAGE send
             // preformatted message using the server locale
             sqlerrmc = buildPreformattedSqlerrmc(se);
@@ -6473,7 +6474,7 @@ class DRDAConnThread extends Thread {
 
     /**
      * Build preformatted SQLException text 
-     * for severe exceptions or SQLExceptions that are not EmbedSQLExceptions.
+     * for severe exceptions or SQLExceptions that are not Derby exceptions.
      * Just send the message text localized to the server locale.
      * 
      * @param se  SQLException for which to build SQLERRMC
@@ -6511,11 +6512,12 @@ class DRDAConnThread extends Thread {
         
         String sqlerrmc = "";
         do {
-            if ( se instanceof EmbedSQLException)
+            StandardException ferry = StandardException.getArgumentFerry(se);
+            if (ferry != null)
             {
-                String messageId = ((EmbedSQLException)se).getMessageId();
+                String messageId = ferry.getMessageId();
                 // arguments are variable part of a message
-                Object[] args = ((EmbedSQLException)se).getArguments();
+                Object[] args = ferry.getArguments();
                 for (int i = 0; args != null &&  i < args.length; i++) {
                     sqlerrmc += args[i] + SQLERRMC_TOKEN_DELIMITER;
                 }
@@ -6734,9 +6736,11 @@ class DRDAConnThread extends Thread {
             // arguments are variable part of a message
             // only send arguments for diagnostic level 0
             if (diagnosticLevel == CodePoint.DIAGLVL0) {
-                // we are only able to get arguments of EmbedSQLException
-                if (se instanceof EmbedSQLException) {
-                    Object[] args = ((EmbedSQLException)se).getArguments();
+                // we are only able to get arguments of Derby exceptions
+                StandardException ferry =
+                        StandardException.getArgumentFerry(se);
+                if (ferry != null) {
+                    Object[] args = ferry.getArguments();
                     for (int i = 0; args != null &&  i < args.length; i++) {
                         sqlerrmc += args[i].toString() + SQLERRMC_TOKEN_DELIMITER;
                     }

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java?rev=1573534&r1=1573533&r2=1573534&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java Mon Mar  3 12:14:06 2014
@@ -79,7 +79,6 @@ import org.apache.derby.shared.common.sa
 import org.apache.derby.iapi.tools.i18n.LocalizedOutput;
 import org.apache.derby.iapi.tools.i18n.LocalizedResource;
 import org.apache.derby.iapi.util.StringUtil;
-import org.apache.derby.impl.jdbc.EmbedSQLException;
 import org.apache.derby.impl.jdbc.Util;
 import org.apache.derby.mbeans.VersionMBean;
 import org.apache.derby.mbeans.drda.NetworkServerMBean;
@@ -2099,13 +2098,14 @@ public final class NetworkServerControlI
         //localize message if necessary
         while (se != null)
         {
+            StandardException ferry = StandardException.getArgumentFerry(se);
             if (currentSession != null && currentSession.langUtil != null &&
-                se instanceof EmbedSQLException)
+                ferry != null)
             {
                 locMsg.append(se.getSQLState()+":"+ 
                     MessageService.getLocalizedMessage(
-                    currentSession.langUtil.getLocale(), ((EmbedSQLException)se).getMessageId(), 
-                    ((EmbedSQLException)se).getArguments()));
+                    currentSession.langUtil.getLocale(),
+                    ferry.getMessageId(), ferry.getArguments()));
             }
             else
                 locMsg.append(se.getSQLState()+":"+se.getMessage());

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/error/PublicAPI.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/error/PublicAPI.java?rev=1573534&r1=1573533&r2=1573534&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/error/PublicAPI.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/error/PublicAPI.java Mon Mar  3 12:14:06 2014
@@ -22,18 +22,12 @@
 package org.apache.derby.iapi.error;
 
 import java.sql.SQLException;
-
-import org.apache.derby.impl.jdbc.EmbedSQLException;
-
+import org.apache.derby.iapi.jdbc.ExceptionFactory;
 
 /**
 	Class that wraps StandardExceptions in a SQLException.
 	This is used to make any public API methods always
 	throw SQLException rather than a random collection.
-	This wrapping is also special cased by TypeStatementException
-	to avoid double wrapping of some errors.
-	<P>
-	This will get cleaned up in main.
  */
 public class PublicAPI
 {
@@ -42,7 +36,9 @@ public class PublicAPI
 		operation failed due to a database error.
 	 */
 	public static SQLException wrapStandardException(StandardException se) {
-		return EmbedSQLException.wrapStandardException(se.getMessage(),
-			se.getMessageId(), se.getSeverity(), se);
+        se.markAsPublicAPI();
+        return ExceptionFactory.getInstance().getSQLException(
+                se.getMessage(), se.getMessageId(), (SQLException) null,
+                se.getSeverity(), se, se.getArguments());
 	}
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/error/StandardException.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/error/StandardException.java?rev=1573534&r1=1573533&r2=1573534&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/error/StandardException.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/error/StandardException.java Mon Mar  3 12:14:06 2014
@@ -60,6 +60,8 @@ public class StandardException extends E
 	private String textMessage;
 	private String sqlState;
 	private transient int report;
+    private transient boolean isForPublicAPI;
+    private transient SQLException next;
 
 	/*
 	** End of constructors
@@ -150,6 +152,27 @@ public class StandardException extends E
 		return sqlState;
 	}
 
+    /**
+     * Get the next {@code SQLException} that should be put into the parent
+     * exception when this instance is converted to an {@code SQLException}.
+     * @return the next exception
+     */
+    public final SQLException getNextException() {
+        return next;
+    }
+
+    /**
+     * Mark this exception as one that is thrown by a public API method.
+     * The purpose is to signal that this should be a top-level exception,
+     * so that it doesn't get wrapped inside multiple layers of other
+     * SQLExceptions or StandardExceptions as it travels up through the
+     * code layers.
+     * @see PublicAPI
+     */
+    final void markAsPublicAPI() {
+        isForPublicAPI = true;
+    }
+
 	/**
 		Convert a message identifer from org.apache.derby.iapi.reference.SQLState to
 		a SQLState five character string.
@@ -337,47 +360,43 @@ public class StandardException extends E
     
     
 	/**
-	 * Unpack the exception, looking for an DerbySQLException, which carries
+     * Unpack the exception, looking for a StandardException, which carries
 	 * the Derby messageID and arguments. 
 	 * @see org.apache.derby.impl.jdbc.SQLExceptionFactory
 	 * @see org.apache.derby.impl.jdbc.Util
 	 */
-	public static SQLException	getArgumentFerry(SQLException se)
+    public static StandardException getArgumentFerry(SQLException se)
 	{
-		if (se instanceof DerbySQLException) {
-			/*
-			 * Cater for pre-JDBC4 scenario.
-			 */
-			return se;
-		}
-		/*
-		 * See DERBY-1178 for background information.
-		 * In JDBC4, the DerbySQLException may be wrapped by a SQLException.
-		 */
-		Throwable	cause = se.getCause();
-
-		if ( (cause == null) || !(cause instanceof DerbySQLException ))	{ return se; }
-		else	{ return (SQLException) cause; }
+        Throwable cause = se.getCause();
+        return (cause instanceof StandardException)
+                ? (StandardException) cause : null;
 	}
 
 
 	public static StandardException unexpectedUserException(Throwable t)
 	{
         // If the exception is an SQLException generated by Derby, it has an
-        // argument ferry which is an DerbySQLException. Use this to check
+        // argument ferry which is a StandardException. Use this to check
         // whether the exception was generated by Derby.
-        DerbySQLException ferry = null;
+        StandardException ferry = null;
         if (t instanceof SQLException) {
-            SQLException sqle =
-                getArgumentFerry((SQLException) t);
-            if (sqle instanceof DerbySQLException) {
-                ferry = (DerbySQLException) sqle;
+            SQLException sqle = (SQLException) t;
+            ferry = getArgumentFerry(sqle);
+
+            // If the ferry is marked for public API, it means we shouldn't
+            // wrap it inside an "unexpected user exception", so just peel
+            // off the parent SQLException and return the ferry.
+            if (ferry != null && ferry.isForPublicAPI) {
+                // If the parent SQLException has any next exceptions, we
+                // need to store a reference to them before the parent is
+                // discarded.
+                ferry.next = sqle.getNextException();
+                return ferry;
             }
         }
-        
+
 		/*
-		** If we have a SQLException that isn't an EmbedSQLException
-		** (i.e. it didn't come from Derby), then we check
+        ** If we have a SQLException that didn't come from Derby, then we check
 		** to see if it is a valid user defined exception range 
 		** (38001-38XXX).  If so, then we convert it into a 
 		** StandardException without further ado.
@@ -400,16 +419,6 @@ public class StandardException extends E
 			}
 		}
 
-		// Look for simple wrappers for 3.0.1 - will be cleaned up in main
-		if (ferry != null) {
-			if (ferry.isSimpleWrapper()) {
-				Throwable wrapped = ((SQLException)ferry).getCause();
-				if (wrapped instanceof StandardException)
-					return (StandardException) wrapped;
-			}
-		}
-
-
 		// no need to wrap a StandardException
 		if (t instanceof StandardException) 
 		{
@@ -441,23 +450,13 @@ public class StandardException extends E
 			** In the past we didn't want to place the class name in
 			** an exception because Cloudscape builds were
 			** obfuscated, so the class name would change from build
-                        ** to build. This is no longer true for Derby, but for
-			** exceptions that are Derby's, i.e. EmbedSQLException,
-			** we use toString(). If this returns an empty or null
+            ** to build. This is no longer true for Derby.
+            ** If the exception has no detail message
 			** then we use the class name to make tracking the 
-                        ** problem down easier, though the lack of a message 
+            ** problem down easier, though the lack of a message
 			** should be seen as a bug.
 			*/
-			String	detailMessage;
-			boolean derbyException = false;
-
-			if (ferry != null) {
-				detailMessage = ferry.toString();
-				derbyException = true;
-			}
-			else {
-				detailMessage = t.getMessage();
-			}
+            String detailMessage = t.getMessage();
 
 			if (detailMessage == null)
 			{
@@ -470,16 +469,13 @@ public class StandardException extends E
 			if (detailMessage.length() == 0) {
 				detailMessage = t.getClass().getName();
 			}
-			else {
-
-				if (!derbyException) {
-					detailMessage = t.getClass().getName() + ": " + detailMessage;
-				}
+            else
+            {
+                detailMessage = t.getClass().getName() + ": " + detailMessage;
 			}
 
-			StandardException se =
+            return
 				newException(SQLState.LANG_UNEXPECTED_USER_EXCEPTION, t, detailMessage);
-			return se;
 		}
 	}
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/SQLExceptionFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/SQLExceptionFactory.java?rev=1573534&r1=1573533&r2=1573534&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/SQLExceptionFactory.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/SQLExceptionFactory.java Mon Mar  3 12:14:06 2014
@@ -70,42 +70,54 @@ public class SQLExceptionFactory extends
         // Create dummy exception which ferries arguments needed to serialize
         // SQLExceptions across the DRDA network layer.
         //
-        t = wrapArgsForTransportAcrossDRDA( message, messageId, next, severity, t, args );
+        StandardException ferry =
+                wrapArgsForTransportAcrossDRDA(messageId, t, args);
 
         final SQLException ex;
         if (sqlState.startsWith(SQLState.CONNECTIVITY_PREFIX)) {
             //no derby sqlstate belongs to
             //TransientConnectionException DERBY-3074
-            ex = new SQLNonTransientConnectionException(message, sqlState, severity, t);
+            ex = new SQLNonTransientConnectionException(
+                    message, sqlState, severity, ferry);
         } else if (sqlState.startsWith(SQLState.SQL_DATA_PREFIX)) {
-            ex = new SQLDataException(message, sqlState, severity, t);
+            ex = new SQLDataException(message, sqlState, severity, ferry);
         } else if (sqlState.startsWith(SQLState.INTEGRITY_VIOLATION_PREFIX)) {
             ex = new SQLIntegrityConstraintViolationException(message, sqlState,
-                    severity, t);
+                    severity, ferry);
         } else if (sqlState.startsWith(SQLState.AUTHORIZATION_SPEC_PREFIX)) {
             ex = new SQLInvalidAuthorizationSpecException(message, sqlState,
-                    severity, t);
+                    severity, ferry);
         }
         else if (sqlState.startsWith(SQLState.TRANSACTION_PREFIX)) {
             ex = new SQLTransactionRollbackException(message, sqlState,
-                    severity, t);
+                    severity, ferry);
         } else if (sqlState.startsWith(SQLState.LSE_COMPILATION_PREFIX)) {
-            ex = new SQLSyntaxErrorException(message, sqlState, severity, t);
+            ex = new SQLSyntaxErrorException(
+                    message, sqlState, severity, ferry);
         } else if (sqlState.startsWith(SQLState.UNSUPPORTED_PREFIX)) {
-            ex = new SQLFeatureNotSupportedException(message, sqlState, severity, t);
+            ex = new SQLFeatureNotSupportedException(
+                    message, sqlState, severity, ferry);
         } else if
                 (
                  sqlState.equals(SQLState.LANG_STATEMENT_CANCELLED_OR_TIMED_OUT.substring(0, 5)) ||
                  sqlState.equals(SQLState.LOGIN_TIMEOUT.substring(0, 5))
                  ) {
-            ex = new SQLTimeoutException(message, sqlState, severity, t);
+            ex = new SQLTimeoutException(message, sqlState, severity, ferry);
         } else {
-            ex = new SQLException(message, sqlState, severity, t);
+            ex = new SQLException(message, sqlState, severity, ferry);
+        }
+
+        // If the argument ferry has recorded any extra next exceptions,
+        // graft them into the parent exception.
+        SQLException ferriedExceptions = ferry.getNextException();
+        if (ferriedExceptions != null) {
+            ex.setNextException(ferriedExceptions);
         }
 
         if (next != null) {
             ex.setNextException(next);
         }
+
         return ex;
     }
 
@@ -128,17 +140,25 @@ public class SQLExceptionFactory extends
      * 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.
+     * 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.
      * </p>
 	 */
-    private SQLException wrapArgsForTransportAcrossDRDA(
-            String message, String messageId, SQLException next,
-            int severity, Throwable t, Object[] args) {
-        return new EmbedSQLException(
-                message, messageId,
-                (next == null ?
-                    null : StandardException.getArgumentFerry(next)),
-                severity, t, args);
+    private StandardException wrapArgsForTransportAcrossDRDA(
+            String messageId, Throwable cause, Object[] args) {
+
+        // If the cause is a StandardException with the same message id, we
+        // already have what we need. Just return that exception.
+        if (cause instanceof StandardException) {
+            StandardException se = (StandardException) cause;
+            if (messageId.equals(se.getMessageId())) {
+                return se;
+            }
+        }
+
+        // Otherwise, we create a new StandardException that carries the
+        // message id and arguments.
+        return StandardException.newException(messageId, cause, args);
     }
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/Util.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/Util.java?rev=1573534&r1=1573533&r2=1573534&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/Util.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/Util.java Mon Mar  3 12:14:06 2014
@@ -168,30 +168,7 @@ public abstract class Util  {
 			try {
 				SanityManager.ASSERT(mustBeTrue, msg);
 			} catch (Throwable t) {
-				SQLException se = conn.handleException(t);
-				// get around typing constraints.
-				// it must be a Util, we wrapped it.
-				SanityManager.ASSERT(se instanceof EmbedSQLException);
-				throw (EmbedSQLException)se;
-			}
-		}
-	}
-
-	/**
-		Mimic SanityManager.THROWASSERT in a JDBC-friendly way,
-		and providing system cleanup for JDBC failures.
-		We need the connection to do cleanup...
-	 */
-	static void THROWASSERT(EmbedConnection conn, String msg) throws SQLException {
-		if (SanityManager.DEBUG) {
-			try {
-				SanityManager.THROWASSERT(msg);
-			} catch (Throwable t) {
-				SQLException se = conn.handleException(t);
-				// get around typing constraints.
-				// it must be a Util, we wrapped it.
-				SanityManager.ASSERT(se instanceof EmbedSQLException);
-				throw (EmbedSQLException)se;
+                throw conn.handleException(t);
 			}
 		}
 	}

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/importExportIJ.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/importExportIJ.out?rev=1573534&r1=1573533&r2=1573534&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/importExportIJ.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/importExportIJ.out Mon Mar  3 12:14:06 2014
@@ -96,7 +96,7 @@ ij> commit;
 ij> --this one should fail as we're still using the default import format
 call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'T2' , 'extin/AccountData_format1.dat' , 
                                     null, null, null, 0) ;
-ERROR 38000: The exception 'java.sql.SQLException: Column 'COLUMN2' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'COLUMN2' is not a column in the target table.' was thrown while evaluating an expression.
+ERROR 38000: The exception 'java.sql.SQLSyntaxErrorException: Column 'COLUMN2' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'COLUMN2' is not a column in the target table.' was thrown while evaluating an expression.
 ERROR 42X04: Column 'COLUMN2' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'COLUMN2' is not a column in the target table.
 ij> values (SYSCS_UTIL.SYSCS_CHECK_TABLE('APP', 'T2'));
 1          
@@ -136,7 +136,7 @@ call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 
                                   null , '16, 15, 1, 4, 19, 200' ,
 				  'extin/AccountData_defaultformat.dat' , 
 				  null, null, null, 0) ;
-ERROR 38000: The exception 'java.sql.SQLException: Column 'COLUMN200' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'COLUMN200' is not a column in the target table.' was thrown while evaluating an expression.
+ERROR 38000: The exception 'java.sql.SQLSyntaxErrorException: Column 'COLUMN200' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'COLUMN200' is not a column in the target table.' was thrown while evaluating an expression.
 ERROR 42X04: Column 'COLUMN200' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'COLUMN200' is not a column in the target table.
 ij> select count(*) from T3;
 ERROR 42X05: Table/View 'T3' does not exist.
@@ -326,7 +326,7 @@ ij> create table Alt2 (	Account	int,
 0 rows inserted/updated/deleted
 ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'ALT2' , 'extin/UnsupportedFormat2.dat' , 
                                       null, null, null, 0) ;
-ERROR 38000: The exception 'java.sql.SQLException: Column 'COLUMN10' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'COLUMN10' is not a column in the target table.' was thrown while evaluating an expression.
+ERROR 38000: The exception 'java.sql.SQLSyntaxErrorException: Column 'COLUMN10' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'COLUMN10' is not a column in the target table.' was thrown while evaluating an expression.
 ERROR 42X04: Column 'COLUMN10' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'COLUMN10' is not a column in the target table.
 ij> select count(*) from Alt2;
 1          
@@ -359,7 +359,7 @@ ij> create table Alt3 (	Account	int,
 0 rows inserted/updated/deleted
 ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'ALT3' , 'extin/AccountData_NullFields.dat' , 
                                       null, null, null, 0) ;
-ERROR 38000: The exception 'java.sql.SQLException: Column 'COLUMN20' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'COLUMN20' is not a column in the target table.' was thrown while evaluating an expression.
+ERROR 38000: The exception 'java.sql.SQLSyntaxErrorException: Column 'COLUMN20' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'COLUMN20' is not a column in the target table.' was thrown while evaluating an expression.
 ERROR 42X04: Column 'COLUMN20' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'COLUMN20' is not a column in the target table.
 ij> select count(*) from Alt3;
 1          
@@ -572,7 +572,7 @@ ij> call SYSCS_UTIL.SYSCS_IMPORT_DATA(nu
 				  null , '2,3,4,5,6,7,8,11,12', 
 				  'extin/Access1.txt' , 
 				  null, null, null, 0) ;
-ERROR 38000: The exception 'java.sql.SQLException: The number of values assigned is not the same as the number of specified or implied columns.' was thrown while evaluating an expression.
+ERROR 38000: The exception 'java.sql.SQLSyntaxErrorException: The number of values assigned is not the same as the number of specified or implied columns.' was thrown while evaluating an expression.
 ERROR 42802: The number of values assigned is not the same as the number of specified or implied columns.
 ij> select * from HouseHoldItem;
 ERROR 42X05: Table/View 'HOUSEHOLDITEM' does not exist.

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/PreparedStatementTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/PreparedStatementTest.java?rev=1573534&r1=1573533&r2=1573534&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/PreparedStatementTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/PreparedStatementTest.java Mon Mar  3 12:14:06 2014
@@ -34,7 +34,6 @@ import java.sql.*;
 
 import org.apache.derby.shared.common.sanity.SanityManager;
 import org.apache.derby.iapi.services.io.DerbyIOException;
-import org.apache.derby.impl.jdbc.EmbedSQLException;
 
 /**
  * This class is used to test JDBC4 specific methods in the PreparedStatement(s)
@@ -1328,10 +1327,10 @@ public class PreparedStatementTest exten
                        preSQLState, sqle);
         // We need to dig a little with the current way exceptions are
         // being reported. We can use getCause because we always run with
-        // Mustang/Java SE 6.
+        // Java SE 6 or later.
         Throwable cause = getLastSQLException(sqle).getCause();
-        assertTrue("Exception not an EmbedSQLException",
-                   cause instanceof EmbedSQLException);
+        assertEquals("org.apache.derby.iapi.error.StandardException",
+                     cause.getClass().getName());
         cause = cause.getCause();
         assertTrue("Exception not a DerbyIOException",
                    cause instanceof DerbyIOException);