db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davi...@apache.org
Subject svn commit: r399078 [1/2] - in /db/derby/code/trunk: java/build/org/apache/derbyBuild/ java/client/org/apache/derby/client/am/ java/client/org/apache/derby/client/net/ java/engine/org/apache/derby/loc/ java/shared/org/apache/derby/shared/common/referen...
Date Tue, 02 May 2006 23:10:48 GMT
Author: davidvc
Date: Tue May  2 16:10:44 2006
New Revision: 399078

URL: http://svn.apache.org/viewcvs?rev=399078&view=rev
Log:
DERBY-846: Internationalze NetAgent to NetDatabaseMetadata40 in org.apache.derby.client.net


Modified:
    db/derby/code/trunk/java/build/org/apache/derbyBuild/splitmessages.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/DisconnectException.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/SQLExceptionFactory40.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/SqlException.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetAgent.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection40.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnectionReply.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnectionRequest.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetCursor.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetDatabaseMetaData40.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSet40.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/Reply.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/Request.java
    db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties
    db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/MessageId.java
    db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/badConnection.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/secureUsers.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/secureUsers1.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/testSecMec.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/testij.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/users.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/users2.out
    db/derby/code/trunk/tools/java/javacc.jar
    db/derby/code/trunk/tools/testing/i18nTestGenerator/clientPrologue.txt
    db/derby/code/trunk/tools/testing/i18nTestGenerator/genClient1.sed
    db/derby/code/trunk/tools/testing/i18nTestGenerator/genClient2.sed

Modified: db/derby/code/trunk/java/build/org/apache/derbyBuild/splitmessages.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/build/org/apache/derbyBuild/splitmessages.java?rev=399078&r1=399077&r2=399078&view=diff
==============================================================================
--- db/derby/code/trunk/java/build/org/apache/derbyBuild/splitmessages.java (original)
+++ db/derby/code/trunk/java/build/org/apache/derbyBuild/splitmessages.java Tue May  2 16:10:44 2006
@@ -101,6 +101,8 @@
         clientMessageIds.add(SQLState.LANG_INVALID_SQL_IN_BATCH);
         clientMessageIds.add(SQLState.CLIENT_RESULT_SET_NOT_OPEN);
         clientMessageIds.add(SQLState.CANT_CONVERT_UNICODE_TO_EBCDIC);
+        clientMessageIds.add(SQLState.SECMECH_NOT_SUPPORTED);
+        clientMessageIds.add(SQLState.DRDA_COMMAND_NOT_IMPLEMENTED);
     }
 
 	public static void main(String[] args) throws Exception {
@@ -203,17 +205,20 @@
     /**
      * Determine if this is a message that the client is using
      *
-     * We assume all message ids starting with "XJ" or "J" are client messages
-     * (even though many of them may not be, it saves the coder the effort
-     * of explicitly adding each XJ or J shared message, and covers 90% of the
-     * shared messages
+     * There are some classes of ids that we assume are client messages
+     * (see code below for the definitive list).
      *
      * All other shared message ids should be added to the static array
      * clientMessageIds, defined at the top of this class
      */
     static boolean isClientMessage(String messageId)
     {
-        if ( messageId.startsWith("XJ") || messageId.startsWith("J") )
+        // Look for message ids that we assume are likely to be used
+        // on the client.  These ones don't need to be explicitly added
+        // to clientMessageIds
+        if ( messageId.startsWith("XJ") || messageId.startsWith("J")  ||
+             messageId.startsWith("XN") || messageId.startsWith("58") ||
+             messageId.startsWith("57") || messageId.startsWith("08"))
         {
             return true;
         }

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/DisconnectException.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/am/DisconnectException.java?rev=399078&r1=399077&r2=399078&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/DisconnectException.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/DisconnectException.java Tue May  2 16:10:44 2006
@@ -21,20 +21,55 @@
 package org.apache.derby.client.am;
 
 public class DisconnectException extends SqlException {
-    public DisconnectException(Agent agent, ClientMessageId msgid, SqlCode sqlcode) {
-        super(agent != null ? agent.logWriter_ : null, msgid, sqlcode);
-    }
-
-    public DisconnectException(Agent agent, ClientMessageId msgid) {
-        super(agent != null ? agent.logWriter_ : null, msgid, 
-            SqlCode.disconnectError);
+    public DisconnectException(Agent agent, ClientMessageId msgid,
+        Object[] args, SqlCode sqlcode, Throwable t)  {
+        super(agent != null ? agent.logWriter_ : null, msgid,
+            args, sqlcode, t);
         
         // make the call to close the streams and socket.
         if (agent != null) {
             agent.disconnectEvent();
         }
     }
+    
+    public DisconnectException(Agent agent, ClientMessageId msgid,
+        Object[] args, SqlCode sqlcode) {
+        this(agent, msgid, args, sqlcode, (Throwable)null);
+    }
+
+    public DisconnectException(Agent agent, ClientMessageId msgid, SqlCode sqlcode) {
+        this(agent, msgid, (Object[]) null, sqlcode);
+    }
+
+        
+    public DisconnectException(Agent agent, ClientMessageId msgid,
+        Object[] args) {
+        this(agent, msgid, args, SqlCode.disconnectError);
+    }
+    
+    public DisconnectException(Agent agent, ClientMessageId msgid,
+        Object[] args, Throwable t) {
+        this(agent, msgid, args, SqlCode.disconnectError, (Throwable)t);
+    }
+    
+    public DisconnectException(Agent agent, ClientMessageId msgid,
+        Object arg1, Throwable t) {
+        this(agent, msgid, new Object[] { arg1 }, t);
+    }
+
+    public DisconnectException(Agent agent, ClientMessageId msgid) {
+        this(agent, msgid, (Object[])null);
+    }
+    
+    public DisconnectException(Agent agent, ClientMessageId msgid, Object arg1) {
+        this(agent, msgid, new Object[] { arg1 });
+    }
         
+    public DisconnectException(Agent agent, ClientMessageId msgid, Object arg1,
+        Object arg2) {
+        this(agent, msgid, new Object[] { arg1, arg2 });
+    }
+    
     // Old constructors for backward compatibility until all classes
     // have been internationalized
     public DisconnectException(Agent agent, String reason, SqlState sqlstate, SqlCode sqlcode) {
@@ -58,7 +93,7 @@
     }
 
     public DisconnectException(Agent agent) {
-        this(agent, null, SqlState.undefined);
+        this(agent, (String)null, SqlState.undefined);
     }
 
     public DisconnectException(java.lang.Throwable throwable, Agent agent) {
@@ -78,5 +113,3 @@
         setNextException(e);
     }
 }
-
-

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/SQLExceptionFactory40.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/am/SQLExceptionFactory40.java?rev=399078&r1=399077&r2=399078&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/SQLExceptionFactory40.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/SQLExceptionFactory40.java Tue May  2 16:10:44 2006
@@ -20,6 +20,7 @@
 package org.apache.derby.client.am;
 
 import org.apache.derby.shared.common.reference.SQLState;
+import org.apache.derby.shared.common.error.ExceptionSeverity;
 
 import java.sql.SQLDataException;
 import java.sql.SQLException;
@@ -36,25 +37,32 @@
 
 public class SQLExceptionFactory40 extends SQLExceptionFactory {
     
+    // Important DRDA SQL States, from DRDA v3 spec, Section 8.2
+    // We have to consider these as well as the standard SQLState classes
+    // when choosing the right exception subclass
+    private static final String DRDA_CONVERSATION_TERMINATED    = "58009";    
+    private static final String DRDA_COMMAND_NOT_SUPPORTED      = "58014";
+    private static final String DRDA_OBJECT_NOT_SUPPORTED       = "58015";
+    private static final String DRDA_PARAM_NOT_SUPPORTED        = "58016";
+    private static final String DRDA_VALUE_NOT_SUPPORTED        = "58017";
+    private static final String DRDA_SQLTYPE_NOT_SUPPORTED      = "56084";
+    private static final String DRDA_CONVERSION_NOT_SUPPORTED   = "57017";
+    private static final String DRDA_REPLY_MSG_NOT_SUPPORTED    = "58018";
+       
     /**
      * creates jdbc4.0 SQLException and its subclass based on sql state
-     * 0A                          java.sql.SQLFeatureNotSupportedException
-     * 08                          java.sql.SQLTransientConnectionException
-     * 22                          java.sql.SQLDataException
-     * 28                          java.sql.SQLInvalidAuthorizationSpecException
-     * 40                          java.sql.SQLTransactionRollbackException
-     * 42                          java.sql.SQLSyntaxErrorException
      * 
      * @param message description of the 
      * @param sqlState 
      * @param errCode derby error code
      */
     public SQLException getSQLException (String message, String sqlState, 
-                                                            int errCode) {        
+                                                            int errCode) { 
         SQLException ex = null;
         if (sqlState == null) {
             ex = new SQLException(message, sqlState, errCode); 
-        } else if (sqlState.startsWith(SQLState.CONNECTIVITY_PREFIX)) {
+        } else if (sqlState.startsWith(SQLState.CONNECTIVITY_PREFIX) ||
+            errCode >= ExceptionSeverity.SESSION_SEVERITY) {
             //none of the sqlstate supported by derby belongs to
             //NonTransientConnectionException
             ex = new SQLTransientConnectionException(message, sqlState, errCode);
@@ -66,12 +74,20 @@
         } else if (sqlState.startsWith(SQLState.AUTHORIZATION_PREFIX)) {
             ex = new SQLInvalidAuthorizationSpecException(message, sqlState,
                     errCode);
-        } else if (sqlState.startsWith(SQLState.TRANSACTION_PREFIX)) {
+        } else if (sqlState.startsWith(SQLState.TRANSACTION_PREFIX) ||
+            errCode >= ExceptionSeverity.TRANSACTION_SEVERITY ) {
             ex = new SQLTransactionRollbackException(message, sqlState,
                     errCode);
         } else if (sqlState.startsWith(SQLState.LSE_COMPILATION_PREFIX)) {
             ex = new SQLSyntaxErrorException(message, sqlState, errCode);
-        } else if (sqlState.startsWith (SQLState.UNSUPPORTED_PREFIX)) {
+        } else if (
+            sqlState.startsWith (SQLState.UNSUPPORTED_PREFIX)   ||
+            sqlState.equals(DRDA_COMMAND_NOT_SUPPORTED)         ||
+            sqlState.equals(DRDA_OBJECT_NOT_SUPPORTED)          ||
+            sqlState.equals(DRDA_PARAM_NOT_SUPPORTED)           ||
+            sqlState.equals(DRDA_VALUE_NOT_SUPPORTED)           ||
+            sqlState.equals(DRDA_SQLTYPE_NOT_SUPPORTED)         ||
+            sqlState.equals(DRDA_REPLY_MSG_NOT_SUPPORTED)           ) {
             ex = new SQLFeatureNotSupportedException(message, sqlState, 
                     errCode);
         } else {

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/SqlException.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/am/SqlException.java?rev=399078&r1=399077&r2=399078&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/SqlException.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/SqlException.java Tue May  2 16:10:44 2006
@@ -136,9 +136,14 @@
      * from the message severity
      */
     public SqlException(LogWriter logWriter, ClientMessageId msgid, Object[] args,
-        SqlCode sqlcode) {
-        this(logWriter, msgid, args);
+        SqlCode sqlcode, Throwable t) {
+        this(logWriter, msgid, args, t);
         this.errorcode_ = sqlcode.getCode();
+    }
+    
+    public SqlException(LogWriter logWriter, ClientMessageId msgid, Object[] args,
+        SqlCode sqlcode) {
+        this(logWriter, msgid, args, sqlcode, (Throwable)null);
     }
         
     public SqlException(LogWriter logWriter, ClientMessageId msgid, SqlCode sqlcode) {

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetAgent.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetAgent.java?rev=399078&r1=399077&r2=399078&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetAgent.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetAgent.java Tue May  2 16:10:44 2006
@@ -25,9 +25,14 @@
 import org.apache.derby.client.am.Agent;
 import org.apache.derby.client.am.DisconnectException;
 import org.apache.derby.client.am.SqlException;
+import org.apache.derby.client.am.ClientMessageId;
 import org.apache.derby.client.am.Utils;
 import org.apache.derby.shared.common.sanity.SanityManager;
 
+import org.apache.derby.shared.common.reference.SQLState;
+import org.apache.derby.shared.common.reference.MessageId;
+import org.apache.derby.shared.common.i18n.MessageUtil;
+
 public class NetAgent extends Agent {
     //---------------------navigational members-----------------------------------
 
@@ -107,14 +112,19 @@
         port_ = port;
         netConnection_ = netConnection;
         if (server_ == null) {
-            throw new DisconnectException(this, "Required property \"serverName\" not set");
+            throw new DisconnectException(this, 
+                new ClientMessageId(SQLState.CONNECT_REQUIRED_PROPERTY_NOT_SET),
+                "serverName");
         }
 
         try {
             socket_ = (java.net.Socket) java.security.AccessController.doPrivileged(new OpenSocketAction(server, port));
         } catch (java.security.PrivilegedActionException e) {
             throw new DisconnectException(this,
-                    e.getClass().getName() + " : Error opening socket to server " + server + " on port " + port + " with message : " + e.getException().getMessage());
+                new ClientMessageId(SQLState.CONNECT_UNABLE_TO_CONNECT_TO_SERVER),
+                new Object[] { e.getClass().getName(), server, new Integer(port), 
+                    e.getException().getMessage() },
+                e.getException());
         }
 
         // Set TCP/IP Socket Properties
@@ -130,7 +140,8 @@
             } catch (java.io.IOException doNothing) {
             }
             exceptionOpeningSocket_ = new DisconnectException(this,
-                    "SocketException '" + e.getMessage() + "'");
+                new ClientMessageId(SQLState.CONNECT_SOCKET_EXCEPTION),
+                e.getMessage(), e);
         }
 
         try {
@@ -143,7 +154,9 @@
                 socket_.close();
             } catch (java.io.IOException doNothing) {
             }
-            exceptionOpeningSocket_ = new DisconnectException(this, "unable to open stream on socket '"+e.getMessage() + "'");
+            exceptionOpeningSocket_ = new DisconnectException(this, 
+                new ClientMessageId(SQLState.CONNECT_UNABLE_TO_OPEN_SOCKET_STREAM),
+                e.getMessage(), e);
         }
 
         sourceCcsidManager_ = new EbcdicCcsidManager(); // delete these
@@ -221,7 +234,9 @@
                 socket_.close();
             } catch (java.io.IOException doNothing) {
             }
-            throw new SqlException(logWriter_, e, "SocketException '" + e.getMessage() + "'");
+            throw new SqlException(logWriter_, 
+                new ClientMessageId(SQLState.SOCKET_EXCEPTION),
+                e.getMessage(), e);
         }
     }
 
@@ -257,17 +272,9 @@
                 // this should be ok since we are going to go an close the socket
                 // immediately following this call.
                 // changing {4} to e.getMessage() may require pub changes
-                accumulatedExceptions =
-                        new SqlException(logWriter_, e, "A communication error has been detected. " +
-                        "Communication protocol being used: {0}. " +
-                        "Communication API being used: {1}. " +
-                        "Location where the error was detected: {2}. " +
-                        "Communication function detecting the error: {3}. " +
-                        "Protocol specific error codes(s) {4}, {5}, {6}. " +
-                        "TCP/IP " + "SOCKETS " + "Agent.close() " +
-                        "InputStream.close() " + e.getMessage() + " " + "* " + "0");
-                //"08001",
-                //-30081);
+                accumulatedExceptions = new SqlException(logWriter_,
+                    new ClientMessageId(SQLState.COMMUNICATION_ERROR),
+                    e.getMessage(), e);
             } finally {
                 rawSocketInputStream_ = null;
             }
@@ -282,15 +289,8 @@
                 // immediately following this call.
                 // changing {4} to e.getMessage() may require pub changes
                 SqlException latestException = new SqlException(logWriter_,
-                        e,
-                        "A communication error has been detected. " +
-                        "Communication protocol being used: {0}. " +
-                        "Communication API being used: {1}. " +
-                        "Location where the error was detected: {2}. " +
-                        "Communication function detecting the error: {3}. " +
-                        "Protocol specific error codes(s) {4}, {5}, {6}. " +
-                        "TCP/IP " + "SOCKETS " + "Agent.close() " +
-                        "OutputStream.close() " + e.getMessage() + " " + "* " + "0");
+                    new ClientMessageId(SQLState.COMMUNICATION_ERROR),
+                    e.getMessage(), e);
                 accumulatedExceptions = Utils.accumulateSQLException(latestException, accumulatedExceptions);
             } finally {
                 rawSocketOutputStream_ = null;
@@ -306,15 +306,8 @@
                 // do this for now and but may need to modify or
                 // add this to the message pubs.
                 SqlException latestException = new SqlException(logWriter_,
-                        e,
-                        "A communication error has been detected. " +
-                        "Communication protocol being used: {0}. " +
-                        "Communication API being used: {1}. " +
-                        "Location where the error was detected: {2}. " +
-                        "Communication function detecting the error: {3}. " +
-                        "Protocol specific error codes(s) {4}, {5}, {6}. " +
-                        "TCP/IP " + "SOCKETS " + "Agent.close() " +
-                        "Socket.close() " + e.getMessage() + " " + "* " + "0");
+                    new ClientMessageId(SQLState.COMMUNICATION_ERROR),
+                        e.getMessage(), e);
                 accumulatedExceptions = Utils.accumulateSQLException(latestException, accumulatedExceptions);
             } finally {
                 socket_ = null;
@@ -385,10 +378,7 @@
         try {
             request_.flush(rawSocketOutputStream_);
         } catch (java.io.IOException e) {
-            throwCommunicationsFailure("NetAgent.sendRequest()",
-                    "OutputStream.flush()",
-                    e.getMessage(),
-                    "*");
+            throwCommunicationsFailure(e);
         }
     }
 
@@ -408,25 +398,18 @@
         rawSocketOutputStream_ = outputStream;
     }
 
-    public void throwCommunicationsFailure(String location,
-                                           String function,
-                                           String rc1,
-                                           String rc2) throws org.apache.derby.client.am.DisconnectException {
+    public void throwCommunicationsFailure(Throwable cause) 
+        throws org.apache.derby.client.am.DisconnectException {
         //org.apache.derby.client.am.DisconnectException
         //accumulateReadExceptionAndDisconnect
         // note when {6} = 0 it indicates the socket was closed.
         // need to still validate any token values against message publications.
-        accumulateChainBreakingReadExceptionAndThrow(new org.apache.derby.client.am.DisconnectException(this,
-                "A communication error has been detected. " +
-                "Communication protocol being used: " + location + ". " +
-                "Communication API being used: " + function + ". " +
-                "Location where the error was detected: " + rc1 + ". " +
-                "Communication function detecting the error: " + rc2 + ". " +
-                "Protocol specific error codes(s) " +
-                "TCP/IP SOCKETS "));  // hardcode tokens 0 and 1
-        //"08001"));  //derby code -30081, don't send 08001 now either
+        accumulateChainBreakingReadExceptionAndThrow(
+            new org.apache.derby.client.am.DisconnectException(this,
+                new ClientMessageId(SQLState.COMMUNICATION_ERROR),
+                cause.getMessage(), cause));
     }
-
+        
     // ----------------------- call-down methods ---------------------------------
 
     public org.apache.derby.client.am.LogWriter newLogWriter_(java.io.PrintWriter printWriter,
@@ -454,7 +437,8 @@
         try {
             netConnection_.writeDeferredReset();
         } catch (SqlException sqle) {
-            DisconnectException de = new DisconnectException(this, "An error occurred during a deferred connect reset and the connection has been terminated.  See chained exceptions for details.");
+            DisconnectException de = new DisconnectException(this, 
+                new ClientMessageId(SQLState.CONNECTION_FAILED_ON_DEFERRED_RESET));
             de.setNextException(sqle);
             throw de;
         }
@@ -484,7 +468,8 @@
             netConnection_.readDeferredReset();
             checkForExceptions();
         } catch (SqlException sqle) {
-            DisconnectException de = new DisconnectException(this, "An error occurred during a deferred connect reset and the connection has been terminated.  See chained exceptions for details.");
+            DisconnectException de = new DisconnectException(this, 
+                new ClientMessageId(SQLState.CONNECTION_FAILED_ON_DEFERRED_RESET));
             de.setNextException(sqle);
             throw de;
         }

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection.java?rev=399078&r1=399077&r2=399078&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection.java Tue May  2 16:10:44 2006
@@ -27,13 +27,22 @@
 import org.apache.derby.client.am.PreparedStatement;
 import org.apache.derby.client.am.ProductLevel;
 import org.apache.derby.client.am.SqlException;
+import org.apache.derby.client.am.ClientMessageId;
+import org.apache.derby.shared.common.reference.MessageId;
+import org.apache.derby.shared.common.i18n.MessageUtil;
 import org.apache.derby.client.am.Statement;
 import org.apache.derby.client.am.Utils;
 import org.apache.derby.jdbc.ClientBaseDataSource;
 import org.apache.derby.jdbc.ClientDataSource;
 import org.apache.derby.jdbc.ClientDriver;
 
+import org.apache.derby.shared.common.reference.SQLState;
+
 public class NetConnection extends org.apache.derby.client.am.Connection {
+    
+    // Use this to get internationalized strings...
+    protected static MessageUtil msgutil = 
+        new MessageUtil(SqlException.CLIENT_MESSAGE_RESOURCE_NAME);
 
     protected NetAgent netAgent_;
 
@@ -332,7 +341,8 @@
                                            String password,
                                            ClientBaseDataSource ds) throws SqlException {
         if (inUnitOfWork_) {
-            throw new SqlException(logWriter, "Connection reset is not allowed when inside a unit of work.");
+            throw new SqlException(logWriter, 
+                new ClientMessageId(SQLState.NET_CONNECTION_RESET_NOT_ALLOWED_IN_UNIT_OF_WORK));
         }
     }
 
@@ -398,7 +408,9 @@
                 break;
 
             default:
-                throw new SqlException(agent_.logWriter_, "security mechanism '" + securityMechanism + "' not supported");
+                throw new SqlException(agent_.logWriter_, 
+                    new ClientMessageId(SQLState.SECMECH_NOT_SUPPORTED),
+                    new Integer(securityMechanism));
             }
         } catch (java.lang.Throwable e) { // if *anything* goes wrong, make sure the connection is destroyed
             // always mark the connection closed in case of an error.
@@ -428,7 +440,7 @@
             throw exceptionToBeThrown;
         }
     }
-
+    
     protected void flowSimpleConnect() throws SqlException {
         netAgent_ = (NetAgent) super.agent_;
         constructExtnam();
@@ -457,7 +469,9 @@
                 exceptionToBeThrown = (SqlException) e;
             } else // any other exceptions will be wrapped by an SqlException first
             {
-                exceptionToBeThrown = new SqlException(agent_.logWriter_, e, "Unexpected throwable caught " + e.toString());
+                exceptionToBeThrown = new SqlException(agent_.logWriter_,
+                    new ClientMessageId(SQLState.JAVA_EXCEPTION),
+                    e.getClass().getName(), e.getMessage(), e);
             }
 
             try {
@@ -510,7 +524,9 @@
                 setDeferredResetPassword(password);
                 return true;
             default:
-                throw new SqlException(agent_.logWriter_, "security mechanism '" + securityMechanism + "' not supported");
+                throw new SqlException(agent_.logWriter_, 
+                    new ClientMessageId(SQLState.SECMECH_NOT_SUPPORTED),
+                    new Integer(securityMechanism));
             }
         } catch (SqlException sqle) {            // this may not be needed because on method up the stack
             open_ = false;                       // all reset exceptions are caught and wrapped in disconnect exceptions
@@ -887,7 +903,8 @@
                 // will be surfaced by endReadChain
                 // agent_.accumulateChainBreakingReadExceptionAndThrow (
                 //   new DisconnectException (agent_,"secmec not supported ","0000", -999));
-                agent_.accumulateReadException(new SqlException(agent_.logWriter_, "secmec not supported"));
+                agent_.accumulateReadException(new SqlException(agent_.logWriter_, 
+                    new ClientMessageId(SQLState.NET_SECKTKN_NOT_RETURNED)));
             }
         }
     }
@@ -975,27 +992,36 @@
     private void checkDatabaseName() throws SqlException {
         // netAgent_.logWriter may not be initialized yet
         if (databaseName_ == null) {
-            throw new SqlException(agent_.logWriter_, "Required property \"databaseName\" not set");
+            throw new SqlException(agent_.logWriter_, 
+                new ClientMessageId(SQLState.CONNECT_REQUIRED_PROPERTY_NOT_SET),
+                "databaseName");
         }
     }
 
     private void checkUserLength(String user) throws SqlException {
         int usridLength = user.length();
         if ((usridLength == 0) || (usridLength > NetConfiguration.USRID_MAXSIZE)) {
-            throw new SqlException(netAgent_.logWriter_, "userid length, " + usridLength + ", is not allowed.");
+            throw new SqlException(netAgent_.logWriter_, 
+                new ClientMessageId(SQLState.CONNECT_USERID_LENGTH_OUT_OF_RANGE),
+                new Integer(usridLength), 
+                new Integer(NetConfiguration.USRID_MAXSIZE));
         }
     }
 
     private void checkPasswordLength(String password) throws SqlException {
         int passwordLength = password.length();
         if ((passwordLength == 0) || (passwordLength > NetConfiguration.PASSWORD_MAXSIZE)) {
-            throw new SqlException(netAgent_.logWriter_, "password length, " + passwordLength + ", is not allowed.");
+            throw new SqlException(netAgent_.logWriter_,
+                new ClientMessageId(SQLState.CONNECT_PASSWORD_LENGTH_OUT_OF_RANGE),
+                new Integer(passwordLength),
+                new Integer(NetConfiguration.PASSWORD_MAXSIZE));
         }
     }
 
     private void checkUser(String user) throws SqlException {
         if (user == null) {
-            throw new SqlException(netAgent_.logWriter_, "null userid not supported");
+            throw new SqlException(netAgent_.logWriter_, 
+                new ClientMessageId(SQLState.CONNECT_USERID_ISNULL));
         }
         checkUserLength(user);
     }
@@ -1003,7 +1029,8 @@
     private void checkUserPassword(String user, String password) throws SqlException {
         checkUser(user);
         if (password == null) {
-            throw new SqlException(netAgent_.logWriter_, "null password not supported");
+            throw new SqlException(netAgent_.logWriter_, 
+                new ClientMessageId(SQLState.CONNECT_PASSWORD_ISNULL));
         }
         checkPasswordLength(password);
     }
@@ -1029,7 +1056,9 @@
 
         // throw an exception if not supported (not on list).
         if (!secmecSupported) {
-            throw new SqlException(agent_.logWriter_, "Security mechananism specified by app not supported by connection");
+            throw new SqlException(agent_.logWriter_, 
+                new ClientMessageId(SQLState.SECMECH_NOT_SUPPORTED),
+                new Integer(securityMechanism));
         }
     }
 
@@ -1047,37 +1076,48 @@
         switch (secchkcd) {
         case CodePoint.SECCHKCD_01:  // ERROR SVRCOD
             return new SqlException(agent_.logWriter_,
-                    "Connection authorization failure occurred.  Reason: security mechanism not supported"); //"08001", -30082);
+                new ClientMessageId(SQLState.NET_CONNECT_AUTH_FAILED),
+                msgutil.getTextMessage(MessageId.CONN_SECMECH_NOT_SUPPORTED));
         case CodePoint.SECCHKCD_10:  // ERROR SVRCOD
             return new SqlException(agent_.logWriter_,
-                    "Connection authorization failure occurred.  Reason: password missing.");
+                new ClientMessageId(SQLState.NET_CONNECT_AUTH_FAILED),
+                msgutil.getTextMessage(MessageId.CONN_PASSWORD_MISSING));
         case CodePoint.SECCHKCD_12:  // ERROR SVRCOD
             return new SqlException(agent_.logWriter_,
-                    "Connection authorization failure occurred.  Reason: userid missing.");
+                new ClientMessageId(SQLState.NET_CONNECT_AUTH_FAILED),
+                msgutil.getTextMessage(MessageId.CONN_USERID_MISSING));
         case CodePoint.SECCHKCD_13:  // ERROR SVRCOD
             return new SqlException(agent_.logWriter_,
-                    "Connection authorization failure occurred.  Reason: userid invalid.");
+                new ClientMessageId(SQLState.NET_CONNECT_AUTH_FAILED),
+                msgutil.getTextMessage(MessageId.CONN_USERID_OR_PASSWORD_INVALID));
         case CodePoint.SECCHKCD_14:  // ERROR SVRCOD
             return new SqlException(agent_.logWriter_,
-                    "Connection authorization failure occurred.  Reason: userid revoked.");
+                new ClientMessageId(SQLState.NET_CONNECT_AUTH_FAILED),
+                msgutil.getTextMessage(MessageId.CONN_USERID_REVOKED));
         case CodePoint.SECCHKCD_15:  // ERROR SVRCOD
             return new SqlException(agent_.logWriter_,
-                    "Connection authorization failure occurred.  Reason: new password invalid.");
+                new ClientMessageId(SQLState.NET_CONNECT_AUTH_FAILED),
+                msgutil.getTextMessage(MessageId.CONN_NEW_PASSWORD_INVALID));
         case CodePoint.SECCHKCD_0A:  // ERROR SVRCOD
             return new SqlException(agent_.logWriter_,
-                    "Connection authorization failure occurred.  Reason: local security service non-retryable error.");
+                new ClientMessageId(SQLState.NET_CONNECT_AUTH_FAILED),
+                msgutil.getTextMessage(MessageId.CONN_SECSVC_NONRETRYABLE_ERR));
         case CodePoint.SECCHKCD_0B:  // ERROR SVRCOD
             return new SqlException(agent_.logWriter_,
-                    "Connection authorization failure occurred.  Reason: SECTKN missing on ACCSEC when it is required or it is invalid");
+                new ClientMessageId(SQLState.NET_CONNECT_AUTH_FAILED),
+                msgutil.getTextMessage(MessageId.CONN_SECTKN_MISSING_OR_INVALID));
         case CodePoint.SECCHKCD_0E:  // ERROR SVRCOD
             return new SqlException(agent_.logWriter_,
-                    "Connection authorization failure occurred.  Reason: password expired.");
+                new ClientMessageId(SQLState.NET_CONNECT_AUTH_FAILED),
+                msgutil.getTextMessage(MessageId.CONN_PASSWORD_EXPIRED));
         case CodePoint.SECCHKCD_0F:  // ERROR SVRCOD
             return new SqlException(agent_.logWriter_,
-                    "Connection authorization failure occurred.  Reason: password invalid.");
+                new ClientMessageId(SQLState.NET_CONNECT_AUTH_FAILED),
+                msgutil.getTextMessage(MessageId.CONN_USERID_OR_PASSWORD_INVALID));
         default:  // ERROR SVRCOD
             return new SqlException(agent_.logWriter_,
-                    "Connection authorization failure occurred.  Reason: not specified.");
+                new ClientMessageId(SQLState.NET_CONNECT_AUTH_FAILED),
+                msgutil.getTextMessage(MessageId.CONN_NOT_SPECIFIED));
         }
     }
 

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection40.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection40.java?rev=399078&r1=399077&r2=399078&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection40.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection40.java Tue May  2 16:10:44 2006
@@ -281,8 +281,9 @@
         try { 
             return interfaces.cast(this);
         } catch (ClassCastException cce) {
-            throw new SqlException(null,new ClientMessageId(SQLState.UNABLE_TO_UNWRAP),
-                    interfaces).getSQLException();
+            throw new SqlException(null,
+                new ClientMessageId(SQLState.UNABLE_TO_UNWRAP),
+                interfaces).getSQLException();
         }
     }
     

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnectionReply.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnectionReply.java?rev=399078&r1=399077&r2=399078&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnectionReply.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnectionReply.java Tue May  2 16:10:44 2006
@@ -26,12 +26,20 @@
 import org.apache.derby.client.am.ConnectionCallbackInterface;
 import org.apache.derby.client.am.DisconnectException;
 import org.apache.derby.client.am.SqlException;
-import org.apache.derby.client.am.SqlState;
+import org.apache.derby.client.am.ClientMessageId;
 import org.apache.derby.client.am.Sqlca;
 import java.io.UnsupportedEncodingException;
 
+import org.apache.derby.shared.common.reference.SQLState;
+import org.apache.derby.shared.common.reference.MessageId;
+import org.apache.derby.shared.common.i18n.MessageUtil;
+
+
 public class NetConnectionReply extends Reply
         implements ConnectionReplyInterface {
+    private static MessageUtil msgutil_
+        = new MessageUtil(SqlException.CLIENT_MESSAGE_RESOURCE_NAME);
+    
     NetConnectionReply(NetAgent netAgent, int bufferSize) {
         super(netAgent, bufferSize);
     }
@@ -831,11 +839,8 @@
 
         netAgent_.setSvrcod(svrcod);
         agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_,
-                "Execution failed due to a distribution protocol error that caused " +
-                "deallocation of the conversation.  " +
-                "The requested command encountered an unarchitected and implementation " +
-                "specific condition for which there was no architected message.",
-                SqlState._58009));
+            new ClientMessageId(SQLState.DRDA_CONNECTION_TERMINATED),
+            msgutil_.getTextMessage(MessageId.CONN_DRDA_CMDCHKRM)));
     }
 
 
@@ -907,12 +912,10 @@
         checkRequiredObjects(svrcodReceived, rdbnamReceived);
 
         netAgent_.setSvrcod(svrcod);
-        agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_,
-                "Execution failed due to a distribution protocol error that caused " +
-                "deallocation of the conversation.  " +
-                "The access relational database command was not issued prior to " +
-                "a command requesting RDB services.  ",
-                SqlState._58009));
+        agent_.accumulateChainBreakingReadExceptionAndThrow(
+            new DisconnectException(agent_,
+                new ClientMessageId(SQLState.DRDA_CONNECTION_TERMINATED),
+                msgutil_.getTextMessage(MessageId.CONN_DRDA_RDBNACRM)));            
     }
 
     // RDB Not Found Reply Message indicates that the target
@@ -970,10 +973,8 @@
 
         netAgent_.setSvrcod(svrcod);
         agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_,
-                "The application server rejected establishment of the connection.  " +
-                "An attempt was made to access a database, " +
-                netConnection.databaseName_ + ", which was not found.",
-                SqlState._08004));
+            new ClientMessageId(SQLState.NET_DATABASE_NOT_FOUND),
+            netConnection.databaseName_));
     }
 
 
@@ -1032,9 +1033,8 @@
 
         netAgent_.setSvrcod(svrcod);
         netAgent_.accumulateReadException(new SqlException(agent_.logWriter_,
-                "The application server rejected establishment of the connection.  " +
-                "The user is not authorized to access the database.",
-                SqlState._08004));
+            new ClientMessageId(SQLState.NET_CONNECT_AUTH_FAILED),
+            msgutil_.getTextMessage(MessageId.CONN_USER_NOT_AUTHORIZED_TO_DB)));
     }
 
     // Data Stream Syntax Error Reply Message indicates that the data
@@ -1198,11 +1198,8 @@
 
         netAgent_.setSvrcod(svrcod);
         agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_,
-                "Execution failed due to a distribution protocol error that caused " +
-                "deallocation of the conversation.  " +
-                "The access relational database command cannot be issued because an " +
-                "RDB is already currently accessed.",
-                SqlState._58009));
+            new ClientMessageId(SQLState.DRDA_CONNECTION_TERMINATED),
+            msgutil_.getTextMessage(MessageId.CONN_DRDA_RDBACCRM)));
     }
 
     // RDB Access Failed Reply Message specifies that the relational
@@ -1697,10 +1694,8 @@
 
         netAgent_.setSvrcod(svrcod);
         agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_,
-                "The DDM command is not supported.  " +
-                "Unsupported DDM command code point: " +
-                "0x" + Integer.toHexString(codpnt),
-                SqlState._58014));
+            new ClientMessageId(SQLState.DRDA_DDM_COMMAND_NOT_SUPPORTED),
+                Integer.toHexString(codpnt)));
     }
 
     // Abnormal End Unit of Work Condition Reply Message indicates
@@ -2785,17 +2780,15 @@
 
     protected void doObjnsprmSemantics(int codePoint) throws DisconnectException {
         agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_,
-                "The DDM object is not supported.  " +
-                "Unsupported DDM object code point: 0x" + Integer.toHexString(codePoint),
-                SqlState._58015));
+            new ClientMessageId(SQLState.DRDA_DDM_OBJECT_NOT_SUPPORTED),
+            Integer.toHexString(codePoint)));
     }
 
     // Also called by NetStatementReply.
     protected void doPrmnsprmSemantics(int codePoint) throws DisconnectException {
         agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_,
-                "The DDM parameter is not supported.  " +
-                "Unsupported DDM parameter code point: 0x" + Integer.toHexString(codePoint),
-                SqlState._58016));
+            new ClientMessageId(SQLState.DRDA_DDM_PARAM_NOT_SUPPORTED),
+            Integer.toHexString(codePoint)));
     }
 
     // Also called by NetStatementReply
@@ -2808,10 +2801,8 @@
         // special case the FDODTA codepoint not to disconnect.
         if (codePoint == CodePoint.FDODTA) {
             agent_.accumulateReadException(new SqlException(agent_.logWriter_,
-                    "The DDM parameter value is not supported.  " +
-                    "DDM parameter code point having unsupported value : 0x" + Integer.toHexString(codePoint) +
-                    ".  An input host variable may not be within the range the server supports.",
-                    SqlState._58017));
+                new ClientMessageId(SQLState.DRDA_DDM_PARAMVAL_NOT_SUPPORTED),
+                Integer.toHexString(codePoint)));
             return;
         }
 
@@ -2841,9 +2832,8 @@
                 break;
             }
             agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_,
-                    "There is no available conversion for the source code page, " + cpValue +
-                    ", to the target code page, " + value + "."));
-            //"57017", -332));
+                new ClientMessageId(SQLState.DRDA_NO_AVAIL_CODEPAGE_CONVERSION),
+                new Integer(cpValue), value));
             return;
         }
         // the problem isn't with one of the ccsid values so...
@@ -2851,18 +2841,14 @@
         // Returning more information would
         // require rearranging this code a little.
         agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_,
-                "The DDM parameter value is not supported.  " +
-                "DDM parameter code point having unsupported value : 0x" + Integer.toHexString(codePoint),
-                SqlState._58017));
-
+            new ClientMessageId(SQLState.DRDA_DDM_PARAMVAL_NOT_SUPPORTED),
+            Integer.toHexString(codePoint)));
     }
 
     void doDtamchrmSemantics() throws DisconnectException {
         agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_,
-                "Execution failed due to a distribution protocol error that caused " +
-                "deallocation of the conversation.  " +
-                "A Data Descriptor Mismatch Error was detected.",
-                SqlState._58009));
+            new ClientMessageId(SQLState.DRDA_CONNECTION_TERMINATED),
+                msgutil_.getTextMessage(MessageId.CONN_DRDA_DTARMCHRM)));
     }
 
     // Messages
@@ -2881,12 +2867,8 @@
     //       is producted for SQL CONNECT statement.
     private void doMgrlvlrmSemantics(String manager, String level) throws DisconnectException {
         agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_,
-                "Execution failed due to a distribution protocol error that will " +
-                "affect the successful execution of subsequent DDM commands or SQL statements.  " +
-                "A connection could not be established to the database because " +
-                "manager " + manager + " at level " + level + " is not supported.",
-                SqlState._58010));
-
+            new ClientMessageId(SQLState.DRDA_MGRLVLRM),
+            manager, level));
     }
 
     private void doMgrlvlrmSemantics(int manager, int level) throws DisconnectException {
@@ -2963,11 +2945,9 @@
         // we may need to map the conversation protocol error code, prccnvcd, to some kind
         // of reason code.  For now just return the prccnvcd as the reason code
         agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_,
-                "Execution failed due to a distribution protocol error that caused " +
-                "deallocation of the conversation.  " +
-                "A PROTOCOL Conversational Protocol Error was detected.  " +
-                "Reason: 0x" + Integer.toHexString(conversationProtocolErrorCode),
-                SqlState._58009));
+            new ClientMessageId(SQLState.DRDA_CONNECTION_TERMINATED),
+                msgutil_.getTextMessage(MessageId.CONN_DRDA_PRCCNVRM, 
+                    Integer.toHexString(conversationProtocolErrorCode))));
     }
 
     // SQL Diagnostics Condition Token Array - Identity 0xF7

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnectionRequest.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnectionRequest.java?rev=399078&r1=399077&r2=399078&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnectionRequest.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnectionRequest.java Tue May  2 16:10:44 2006
@@ -24,7 +24,9 @@
 import javax.transaction.xa.Xid;
 
 import org.apache.derby.client.am.SqlException;
+import org.apache.derby.client.am.ClientMessageId;
 import org.apache.derby.client.am.Utils;
+import org.apache.derby.shared.common.reference.SQLState;
 
 public class NetConnectionRequest extends Request implements ConnectionRequestInterface {
     NetConnectionRequest(NetAgent netAgent, CcsidManager ccsidManager, int bufferSize) {
@@ -477,9 +479,8 @@
             if (rdbnamLength <= NetConfiguration.PKG_IDENTIFIER_MAX_LEN) {
                 writeScalarString(CodePoint.RDBNAM, rdbnam);
             } else {
-                throw new SqlException(netAgent_.logWriter_, "Length of the Relational Database Name, " +
-                        rdbnam +
-                        ", exceeds maximum size allowed for PROTOCOL Connection.");// +
+                throw new SqlException(netAgent_.logWriter_, 
+                    new ClientMessageId(SQLState.NET_DBNAME_TOO_LONG), rdbnam);
             }
             //"at SQLAM level " + netAgent_.targetSqlam_);
         }
@@ -487,7 +488,8 @@
 
     private void buildSECTKN(byte[] sectkn) throws SqlException {
         if (sectkn.length > NetConfiguration.SECTKN_MAXSIZE) {
-            throw new SqlException(netAgent_.logWriter_, "bug check: sectkn too long");
+            throw new SqlException(netAgent_.logWriter_, 
+                new ClientMessageId(SQLState.NET_SECTKN_TOO_LONG));
         }
         writeScalarBytes(CodePoint.SECTKN, sectkn);
     }
@@ -495,7 +497,8 @@
     private void buildUSRID(String usrid) throws SqlException {
         int usridLength = usrid.length();
         if ((usridLength == 0) || (usridLength > NetConfiguration.USRID_MAXSIZE)) {
-            throw new SqlException(netAgent_.logWriter_, "userid length, " + usridLength + ", is not allowed.");
+            throw new SqlException(netAgent_.logWriter_, 
+                new ClientMessageId(SQLState.NET_USERID_TOO_LONG));
         }
 
         writeScalarString(CodePoint.USRID, usrid);
@@ -504,7 +507,8 @@
     private void buildPASSWORD(String password) throws SqlException {
         int passwordLength = password.length();
         if ((passwordLength == 0) || (passwordLength > NetConfiguration.PASSWORD_MAXSIZE)) {
-            throw new SqlException(netAgent_.logWriter_, "password length, " + passwordLength + ", is not allowed.");
+            throw new SqlException(netAgent_.logWriter_, 
+                new ClientMessageId(SQLState.NET_PASSWORD_TOO_LONG));
         }
         if (netAgent_.logWriter_ != null) {
             // remember the position of password in order to

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetCursor.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetCursor.java?rev=399078&r1=399077&r2=399078&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetCursor.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetCursor.java Tue May  2 16:10:44 2006
@@ -26,12 +26,15 @@
 import org.apache.derby.client.am.DisconnectException;
 import org.apache.derby.client.am.SignedBinary;
 import org.apache.derby.client.am.SqlException;
+import org.apache.derby.client.am.ClientMessageId;
 import org.apache.derby.client.am.SqlWarning;
 import org.apache.derby.client.am.Types;
 import org.apache.derby.client.am.SqlCode;
 import org.apache.derby.shared.common.reference.SQLState;
 import org.apache.derby.shared.common.sanity.SanityManager;
 
+import org.apache.derby.shared.common.reference.SQLState;
+
 public class NetCursor extends org.apache.derby.client.am.Cursor {
 
     NetResultSet netResultSet_;
@@ -797,7 +800,8 @@
         }
 
         netAgent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(netAgent_,
-                "parseSQLDIAGGRP not yet implemented"));
+                new ClientMessageId(SQLState.DRDA_COMMAND_NOT_IMPLEMENTED),
+                "parseSQLDIAGGRP"));
     }
 
     private String parseVCS(Typdef typdefInEffect) throws DisconnectException, SqlException {
@@ -830,9 +834,11 @@
         try {
             s = new String(dataBuffer_, position_, length, encoding);
         } catch (java.io.UnsupportedEncodingException e) {
-            netAgent_.accumulateChainBreakingReadExceptionAndThrow(new org.apache.derby.client.am.DisconnectException(e,
-                    netAgent_,
-                    "encoding not supported!!"));
+            netAgent_.accumulateChainBreakingReadExceptionAndThrow(
+                new org.apache.derby.client.am.DisconnectException(
+                    netAgent_, 
+                    new ClientMessageId(SQLState.NET_ENCODING_NOT_SUPPORTED), 
+                    e));
         }
 
         position_ += length;
@@ -1038,7 +1044,8 @@
             if (sqlcode < 0) {
                 sqlException = new SqlException(agent_.logWriter_, netResultSet_.queryTerminatingSqlca_);
             } else {
-                sqlException = new SqlException(agent_.logWriter_, "Query processing has been terminated due to error on the server.");
+                sqlException = new SqlException(agent_.logWriter_, 
+                    new ClientMessageId(SQLState.NET_QUERY_PROCESSING_TERMINATED));
             }
             try {
                 netResultSet_.closeX(); // the auto commit logic is in closeX()

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetDatabaseMetaData40.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetDatabaseMetaData40.java?rev=399078&r1=399077&r2=399078&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetDatabaseMetaData40.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetDatabaseMetaData40.java Tue May  2 16:10:44 2006
@@ -76,8 +76,9 @@
         try { 
             return interfaces.cast(this);
         } catch (ClassCastException cce) {
-            throw new SqlException(null,new ClientMessageId(SQLState.UNABLE_TO_UNWRAP),
-                    interfaces).getSQLException();
+            throw new SqlException(null,
+                new ClientMessageId(SQLState.UNABLE_TO_UNWRAP),
+                interfaces).getSQLException();
         }
     }
 }

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSet40.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSet40.java?rev=399078&r1=399077&r2=399078&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSet40.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSet40.java Tue May  2 16:10:44 2006
@@ -174,8 +174,9 @@
         try { 
             return interfaces.cast(this);
         } catch (ClassCastException cce) {
-            throw new SqlException(null,new ClientMessageId(SQLState.UNABLE_TO_UNWRAP),
-                    interfaces).getSQLException();
+            throw new SqlException(null,
+                new ClientMessageId(SQLState.UNABLE_TO_UNWRAP),
+                interfaces).getSQLException();
         }
     }
     

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/Reply.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/net/Reply.java?rev=399078&r1=399077&r2=399078&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/Reply.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/Reply.java Tue May  2 16:10:44 2006
@@ -26,7 +26,11 @@
 
 import org.apache.derby.client.am.SignedBinary;
 import org.apache.derby.client.am.SqlException;
+import org.apache.derby.client.am.DisconnectException;
 import org.apache.derby.client.am.SqlState;
+import org.apache.derby.client.am.ClientMessageId;
+
+import org.apache.derby.shared.common.reference.SQLState;
 
 public class Reply {
     protected org.apache.derby.client.am.Agent agent_;
@@ -167,10 +171,7 @@
                 // oops, we shouldn't expose the agent's input stream here, collapse this into a read method on the agent
                 actualBytesRead = netAgent_.getInputStream().read(buffer_, count_, buffer_.length - count_);
             } catch (java.io.IOException ioe) {
-                netAgent_.throwCommunicationsFailure("Reply.fill()",
-                        "InputStream.read()",
-                        ioe.getMessage(),
-                        "*");
+                netAgent_.throwCommunicationsFailure(ioe);
             } finally {
                 if (agent_.loggingEnabled()) {
                     ((NetLogWriter) netAgent_.logWriter_).traceProtocolFlow(buffer_,
@@ -189,10 +190,11 @@
 
         if (actualBytesRead == -1) {
             if (totalBytesRead < minimumBytesNeeded) {
-                netAgent_.throwCommunicationsFailure("Reply.fill()",
-                        "InputStream.read()",
-                        "insufficient data",
-                        "*");
+                netAgent_.accumulateChainBreakingReadExceptionAndThrow(
+                    new DisconnectException(netAgent_,
+                        new ClientMessageId(SQLState.NET_INSUFFICIENT_DATA),
+                        new Integer(minimumBytesNeeded),
+                        new Integer(totalBytesRead)));
             }
         }
         return totalBytesRead;

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/Request.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/net/Request.java?rev=399078&r1=399077&r2=399078&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/Request.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/Request.java Tue May  2 16:10:44 2006
@@ -339,10 +339,7 @@
                 try {
                     sendBytes(netAgent_.getOutputStream());
                 } catch (java.io.IOException ioe) {
-                    netAgent_.throwCommunicationsFailure("Request.writeScalarStream(...,InputStream)",
-                            "OutputStream.flush()",
-                            ioe.getMessage(),
-                            "*");
+                    netAgent_.throwCommunicationsFailure(ioe);
                 }
             } else {
                 System.arraycopy(encryptedBytes, 0, bytes_, offset_, encryptedBytesLength);
@@ -364,10 +361,7 @@
                     try {
                         sendBytes(netAgent_.getOutputStream());
                     } catch (java.io.IOException ioe) {
-                        netAgent_.throwCommunicationsFailure("Request.writeScalarStream(...,InputStream)",
-                                "OutputStream.flush()",
-                                ioe.getMessage(),
-                                "*");
+                        netAgent_.throwCommunicationsFailure(ioe);
                     }
                 } else {
                     int leftlength = encryptedBytesLength + 2;
@@ -661,10 +655,7 @@
                 try {
                     sendBytes(netAgent_.getOutputStream());
                 } catch (java.io.IOException ioe) {
-                    netAgent_.throwCommunicationsFailure("Request.writeScalarStream(...,InputStream)",
-                            "OutputStream.flush()",
-                            ioe.getMessage(),
-                            "*");
+                    netAgent_.throwCommunicationsFailure(ioe);
                 }
             } else {
                 System.arraycopy(encryptedBytes, 0, bytes_, offset_, encryptedBytesLength);
@@ -685,10 +676,7 @@
                     try {
                         sendBytes(netAgent_.getOutputStream());
                     } catch (java.io.IOException ioe) {
-                        netAgent_.throwCommunicationsFailure("Request.writeScalarStream(...,InputStream)",
-                                "OutputStream.flush()",
-                                ioe.getMessage(),
-                                "*");
+                        netAgent_.throwCommunicationsFailure(ioe);
                     }
                 } else {
                     int leftlength = encryptedBytesLength + 2;
@@ -739,10 +727,7 @@
                 }
                 sendBytes(netAgent_.getOutputStream());
             } catch (java.io.IOException e) {
-                netAgent_.throwCommunicationsFailure("Request.writeScalarStream(...,InputStream)",
-                        "OutputStream.flush()",
-                        e.getMessage(),
-                        "*");
+                netAgent_.throwCommunicationsFailure(e);
             }
         }
 
@@ -782,10 +767,7 @@
                 try {
                     sendBytes(netAgent_.getOutputStream());
                 } catch (java.io.IOException ioe) {
-                    netAgent_.throwCommunicationsFailure("Request.writeScalarStream(...,InputStream)",
-                            "OutputStream.flush()",
-                            ioe.getMessage(),
-                            "*");
+                    netAgent_.throwCommunicationsFailure(ioe);
                 }
             }
             dssLengthLocation_ = offset_;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties?rev=399078&r1=399077&r2=399078&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties Tue May  2 16:10:44 2006
@@ -259,6 +259,21 @@
 40XT7=Operation is not supported in an internal transaction.
 
 #
+# 57,58 - DRDA errors with SQLStates required by the spec
+
+# 58009 is a generic message
+# MAKE SURE YOU INTERNATIONALIZE THE REASON STRING AS WELL - Use the JXXX 
+# codes below.  Add constants for the JXXX codes in reference.MessageId.java
+58009.C=A network protocol error was encountered and the connection has been terminated: {0}
+58010.C=A network protocol error was encountered.  A connection could not be established because the manager {0} at level {1} is not supported by the server. 
+58014.C=The DDM command 0x{0} is not supported.  The connection has been terminated.
+58015.C=The DDM object 0x{0} is not supported.  The connection has been terminated.
+58016.C=The DDM parameter 0x{0} is not supported.  The connection has been terminated.
+58017.C=The DDM parameter value 0x{0} is not supported.  An input host variable may not be within the range the server supports.  The connection has been terminated.
+57017.C=There is no available conversion for the source code page, {0}, to the target code page, {1}.  The connection has been terminated.
+
+
+#
 #java/com/ibm/db2j/internalUtil
 #	Id Parse Errors       			XCXA0-XCXAZ
 #  	Db Class Path Parse Errors 	 	XCXB0-XCXBZ
@@ -1200,7 +1215,15 @@
 XJ210.S=The load module name for the stored procedure on the server is not found.
 XJ211.S=Non-recoverable chain-breaking exception occurred during batch processing. The batch is terminated non-atomically.
 
-
+#XN - Network level messages
+XN001.S=Connection reset is not allowed when inside a unit of work.
+XN002.U=secktn was not returned.
+XN003.C=A connection could not be established because the database name ''{0}'' is larger than the maximum length allowed by the network protocol.
+XN004.C=A connection could not be established because the security token is larger than the maximum allowed by the network protocol.
+XN005.C=A connection could not be established because the user id has a length of zero or is larger than the maximum allowed by the network protocol.
+XN006.C=A connection could not be established because the password has a length of zero or is larger than the maximum allowed by the network protocol.
+XN007.C=The connection was terminated because the encoding is not supported.
+XN008.S=Query processing has been terminated due to an error on the server.
 
 # 0A - SQLState class indicating feature not supported
 0A000.S=Feature not implemented: {0}.
@@ -1208,6 +1231,8 @@
 0A000.S.2=JDBC method {0} is not supported by the server. Please upgrade the server.
 0A000.S.3=resultSetHoldability property {0} not supported
 0A000.S.4=cancel() not supported by the server.
+0A000.S.5=Security mechanism ''{0}'' is not supported.
+0A000.C.6=The DRDA command {0} is not currently implemented.  The connection has been terminated.
 
 
 XJ004.C=Database ''{0}'' not found.
@@ -1217,8 +1242,16 @@
 08003=No current connection.
 08003.C.1=getConnection() is not valid on a closed PooledConnection.
 08003.C.2=Lob method called after connection was closed
+
+# NOTE - the {0} parameter needs to be internationalized too.  Don't
+# just put in a hardcoded string in your exception code.
 08004=Connection refused : {0}
 
+# NOTE - the {0} reason needs to be internationalized too.  Don't
+# just put in a hardcoded string in your exception code.
+08004.C.1=Connection authentication failure occurred.  Reason: {0}.
+08004.C.2=The connection was refused because the database {0} was not found.
+
 XJ028.C=The URL ''{0}'' is not properly formed.
 XJ040.C=Failed to start database ''{0}'', see the next exception for details.
 XJ041.C=Failed to create database ''{0}'', see the next exception for details.
@@ -1228,8 +1261,21 @@
 
 XXXXX.C.6=Normal database session close.
 
+08001.C.1=Required property {0} not set.
+08001.C.2={0} : Error connecting to server {1} on port {2} with message {3}.
+08001.C.3=SocketException: ''{0}''
+08001.C.4=Unable to open stream on socket: ''{0}''.
+08001.C.5=User id length ({1}) is outside the range of 1 to {2}.
+08001.C.6=Password length ({1}) is outside the range of 1 to {2}.
+08001.C.7=User id can not be null.
+08001.C.8=Password can not be null.
+
 08006.D=Database ''{0}'' shutdown.
 08006.C.1=An error occurred during connect reset and the connection has been terminated.  See chained exceptions for details.
+08006.C.2=SocketException: ''{0}''
+08006.C.3=A communications error has been detected: {0}.
+08006.C.4=An error occurred during a deferred connect reset and the connection has been terminated.  See chained exceptions for details.
+08006.C.5=Insufficient data while reading from the network - expected a minimum of {0} bytes and received only {1} bytes.  The connection has been terminated.
 
 XJ015.M=Derby system shutdown.
 
@@ -1348,6 +1394,23 @@
 J107=Error for batch element #
 J108=Security manager does not permit access to system property {0}.
 J109=Detected an improper TCP/IP client configuration.  Unable to determine the IP address of your local host: ''{0}''.  Make sure your client machine has a properly configured IP address.
+J110=security mechanism not supported
+J111=password missing
+J112=userid missing
+J113=userid or password invalid
+J114=userid revoked
+J115=new password invalid
+J116=local security service non-retryable error
+J117=SECTKN missing on ACCSEC when it is required or it is invalid
+J118=password expired
+J120=not specified
+J121=the user is not authorized to access the database
+J122=a command requesting services of the database was issued prior to the command requesting access to database (ACCRDB)
+J123=the requested command encountered an unarchitected and implementation-specific condition for which there was no architected message
+J124=the access relational database (ACCRDB) command cannot be issued because the database is already currently accessed
+J125=a Data Descriptor Mismatch Error was detected.
+J126=a conversational protocol error was detected.  Reason: 0x{0}.
+J127=parseSQLDIAGGRP is not yet implemented
 
 
 # Authentication

Modified: db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/MessageId.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/MessageId.java?rev=399078&r1=399077&r2=399078&view=diff
==============================================================================
--- db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/MessageId.java (original)
+++ db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/MessageId.java Tue May  2 16:10:44 2006
@@ -1,6 +1,6 @@
 /*
 
-   Derby - Class org.apache.derby.iapi.reference.MessageId
+   Derby - Class org.apache.derby.shared.common.reference.MessageId
 
    Copyright 2000, 2004 The Apache Software Foundation or its licensors, as applicable.
 
@@ -125,6 +125,22 @@
     String CONN_NETWORK_SERVER_CLASS_LOAD   = "J101"; // Cannot load the network server constructor
     String CONN_NETWORK_SERVER_START_EXCEPTION = "J102";
     String CONN_NETWORK_SERVER_SHUTDOWN_EXCEPTION = "J103";
+    String CONN_SECMECH_NOT_SUPPORTED       = "J110";
+    String CONN_PASSWORD_MISSING            = "J111";
+    String CONN_USERID_MISSING              = "J112";
+    String CONN_USERID_OR_PASSWORD_INVALID  = "J113";
+    String CONN_USERID_REVOKED              = "J114";
+    String CONN_NEW_PASSWORD_INVALID        = "J115";
+    String CONN_SECSVC_NONRETRYABLE_ERR     = "J116";
+    String CONN_SECTKN_MISSING_OR_INVALID   = "J117";
+    String CONN_PASSWORD_EXPIRED            = "J118";
+    String CONN_NOT_SPECIFIED               = "J120";
+    String CONN_USER_NOT_AUTHORIZED_TO_DB   = "J121";
+    String CONN_DRDA_RDBNACRM               = "J122";
+    String CONN_DRDA_CMDCHKRM               = "J123";
+    String CONN_DRDA_RDBACCRM               = "J124";
+    String CONN_DRDA_DTARMCHRM              = "J125";
+    String CONN_DRDA_PRCCNVRM               = "J126";
 
 	/*
 	** Authentication

Modified: db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java?rev=399078&r1=399077&r2=399078&view=diff
==============================================================================
--- db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java (original)
+++ db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java Tue May  2 16:10:44 2006
@@ -1354,6 +1354,9 @@
     String JDBC_METHOD_NOT_SUPPORTED_BY_SERVER                      = "0A000.S.2";
     String UNSUPPORTED_HOLDABILITY_PROPERTY                         = "0A000.S.3";
     String CANCEL_NOT_SUPPORTED_BY_SERVER                           = "0A000.S.4";
+    String SECMECH_NOT_SUPPORTED                                    = "0A000.S.5";
+    String DRDA_COMMAND_NOT_IMPLEMENTED                             = "0A000.C.6";
+
 
 
 	
@@ -1508,6 +1511,16 @@
     String STORED_PROC_LOAD_MODULE_NOT_FOUND = "XJ210.S";
     String BATCH_CHAIN_BREAKING_EXCEPTION = "XJ211.S";
     
+    //XN - Network-level messages
+    String NET_CONNECTION_RESET_NOT_ALLOWED_IN_UNIT_OF_WORK         = "XN001.S";
+    String NET_SECKTKN_NOT_RETURNED                                 = "XN002.U";
+    String NET_DBNAME_TOO_LONG                                      = "XN003.C";
+    String NET_SECTKN_TOO_LONG                                      = "XN004.C";
+    String NET_USERID_TOO_LONG                                      = "XN005.C";
+    String NET_PASSWORD_TOO_LONG                                    = "XN006.C";
+    String NET_ENCODING_NOT_SUPPORTED                               = "XN007.C";
+    String NET_QUERY_PROCESSING_TERMINATED                          = "XN008.S";
+    
     // Used by server for scrollable updatable insensitive result sets
     // to transmit updated state to client. Internal, not seen by user.
     // Has no message in messages.properties as it is never printed.
@@ -1537,7 +1550,12 @@
     // Connection exceptions - SQL State class 08
     //following are database severity
     String NO_CURRENT_CONNECTION = "08003";
+    
+    // 08004 SQL State means the server rejected the connection request
     String LOGIN_FAILED = "08004";
+    String NET_CONNECT_AUTH_FAILED                          = "08004.C.1";
+    String NET_DATABASE_NOT_FOUND                           = "08004.C.2";
+        
     // There can be multiple causes for 08003, which according
     // to SQL2003 spec means "connection does not exist"
     // We use a suffix to distinguish them.  Because of the suffix
@@ -1546,7 +1564,32 @@
     String LOB_METHOD_ON_CLOSED_CONNECTION = "08003.C.2";
     
     // 08006 means connection exception - connection failure
-    String CONNECTION_FAILED_ON_RESET = "08006.C.1";
+    String CONNECTION_FAILED_ON_RESET                           = "08006.C.1";
+    // Use this version of SOCKET_EXCEPTION any time *except* when trying to
+    // establish a connection, as the SQLState is different.  When trying
+    // to establish a connection, use CONNECT_SOCKET_EXCEPTION.
+    String SOCKET_EXCEPTION                                     = "08006.C.2";
+    String COMMUNICATION_ERROR                                  = "08006.C.3";
+    String CONNECTION_FAILED_ON_DEFERRED_RESET                  = "08006.C.4";
+    String NET_INSUFFICIENT_DATA                                = "08006.C.5";
+    
+    // 08001 is specifically about the SQL client not being able to establish
+    // a connection with the server.  Should only be used for errors that
+    // occur upon attempting to open a connection.
+    // NOTE that if the server *rejects* the connection, that's a different
+    // SQLState- 08004'
+    String CONNECT_REQUIRED_PROPERTY_NOT_SET                    = "08001.C.1";
+    String CONNECT_UNABLE_TO_CONNECT_TO_SERVER                  = "08001.C.2";
+    // Use this version of socket exception occurs when trying to establish
+    // a connection to the server, as the SQL State 08001 indicates failure
+    // to establish a connection.  If you aren't trying to connect, just
+    // use SOCKET_EXCEPTION
+    String CONNECT_SOCKET_EXCEPTION                             = "08001.C.3";
+    String CONNECT_UNABLE_TO_OPEN_SOCKET_STREAM                 = "08001.C.4";
+    String CONNECT_USERID_LENGTH_OUT_OF_RANGE                   = "08001.C.5";
+    String CONNECT_PASSWORD_LENGTH_OUT_OF_RANGE                 = "08001.C.6";
+    String CONNECT_USERID_ISNULL                                = "08001.C.7";
+    String CONNECT_PASSWORD_ISNULL                              = "08001.C.8";
         
     // system severity
     String SHUTDOWN_DATABASE = "08006.D";  
@@ -1589,8 +1632,15 @@
     /*
      ** Messages whose SQL states are proscribed by DRDA
      */
-    String DRDA_NO_AUTOCOMMIT_UNDER_XA                            = "2D521.S.1";
-    String DRDA_INVALID_XA_STATE_ON_COMMIT_OR_ROLLBACK            = "2D521.S.2";
+    String DRDA_NO_AUTOCOMMIT_UNDER_XA                              = "2D521.S.1";
+    String DRDA_INVALID_XA_STATE_ON_COMMIT_OR_ROLLBACK              = "2D521.S.2"; 
+    String DRDA_CONNECTION_TERMINATED                               = "58009.C";
+    String DRDA_MGRLVLRM                                            = "58010.C";
+    String DRDA_DDM_COMMAND_NOT_SUPPORTED                           = "58014.C";
+    String DRDA_DDM_OBJECT_NOT_SUPPORTED                            = "58015.C";
+    String DRDA_DDM_PARAM_NOT_SUPPORTED                             = "58016.C";
+    String DRDA_DDM_PARAMVAL_NOT_SUPPORTED                          = "58017.C";
+    String DRDA_NO_AVAIL_CODEPAGE_CONVERSION                        = "57017.C";
     
 	/*
 	** org.apache.derby.database.UserUtility

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/badConnection.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/badConnection.out?rev=399078&r1=399077&r2=399078&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/badConnection.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/badConnection.out Tue May  2 16:10:44 2006
@@ -3,13 +3,13 @@
 SQLState is: 08004
 vendorCode is: -4499
 nextException is: null
-reason is: The application server rejected establishment of the connection.  An attempt was made to access a database, testbase, which was not found.
+reason is: The connection was refused because the database testbase was not found.
 Database not Found  (RDBNFNRM)
 passed SQLException all the way to client, then thrown by client...
 SQLState is: 08004
 vendorCode is: -4499
 nextException is: null
-reason is: The application server rejected establishment of the connection.  An attempt was made to access a database, notthere, which was not found.
+reason is: The connection was refused because the database notthere was not found.
 Invalid Attribute  value (RDBAFLRM)
 passed SQLException all the way to client, then thrown by client...
 SQLState is: XJ05B

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/secureUsers.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/secureUsers.out?rev=399078&r1=399077&r2=399078&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/secureUsers.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/secureUsers.out Tue May  2 16:10:44 2006
@@ -81,7 +81,7 @@
 ij> connect 'guestSchemeDB;user=system;password=manager;shutdown=true';
 ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: Database 'guestSchemeDB' shutdown.
 ij> connect 'derbySchemeDB;user=system;password=manager;shutdown=true';
-ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ERROR 08004: Connection authentication failure occurred.  Reason: userid or password invalid.
 ij> connect 'simpleSchemeDB;user=system;password=manager;shutdown=true';
 ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: Database 'simpleSchemeDB' shutdown.
 ij> disconnect all;
@@ -127,9 +127,9 @@
 ij(CONNECTION11)> connect 'derbySchemeDB;user=martin;password=obfuscateIt';
 ij(CONNECTION12)> -- Invalid ones:
 connect 'derbySchemeDB;user=Jamie;password=theHooligan';
-ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ERROR 08004: Connection authentication failure occurred.  Reason: userid or password invalid.
 ij(CONNECTION12)> connect 'derbySchemeDB;user=francois;password=paceesalute';
-ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ERROR 08004: Connection authentication failure occurred.  Reason: userid or password invalid.
 ij(CONNECTION12)> show connections;
 CONNECTION0 - 	jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/wombat;create=true
 CONNECTION1 - 	jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/wombat
@@ -155,9 +155,9 @@
 connect 'simpleSchemeDB;user=Jamie;password=theHooligan';
 ERROR 04501: DERBY SQL error: SQLCODE: -1, SQLSTATE: 04501, SQLERRMC: Database connection refused.
 ij(CONNECTION15)> connect 'simpleSchemeDB;user=dan;password=makeItFaster';
-ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ERROR 08004: Connection authentication failure occurred.  Reason: userid or password invalid.
 ij(CONNECTION15)> connect 'simpleSchemeDB;user=francois;password=corsica';
-ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ERROR 08004: Connection authentication failure occurred.  Reason: userid or password invalid.
 ij(CONNECTION15)> show connections;
 CONNECTION0 - 	jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/wombat;create=true
 CONNECTION1 - 	jdbc:derby://xxxFILTERED_HOSTNAMExxx:1527/wombat
@@ -181,7 +181,7 @@
 No connections available.
 ij> -- Database shutdown - check user - should fail
 connect 'derbySchemeDB;shutdown=true';
-ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ERROR 08004: Connection authentication failure occurred.  Reason: userid or password invalid.
 ij> show connections;
 No connections available.
 ij> -- Database shutdown - check user - should succeed
@@ -197,7 +197,7 @@
 No connections available.
 ij> -- Derby system shutdown - check user - should fail
 connect ';user=jamie;password=LetMeIn;shutdown=true';
-ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ERROR 08004: Connection authentication failure occurred.  Reason: userid or password invalid.
 ij> disconnect all;
 ij> -- Derby system shutdown - check user - should succeed
 connect ';user=system;password=manager;shutdown=true';

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/secureUsers1.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/secureUsers1.out?rev=399078&r1=399077&r2=399078&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/secureUsers1.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/secureUsers1.out Tue May  2 16:10:44 2006
@@ -31,7 +31,7 @@
 ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: Database 'ldapSchemeDB' shutdown.
 ij> disconnect all;
 ij> connect 'ldapSchemeDB;user=mamta;password=yeeHaLdap';
-ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ERROR 08004: Connection authentication failure occurred.  Reason: userid or password invalid.
 ij> show connections;
 No connections available.
 ij> disconnect all;



Mime
View raw message