db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davi...@apache.org
Subject svn commit: r409037 - 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/reference/ to...
Date Wed, 24 May 2006 02:15:58 GMT
Author: davidvc
Date: Tue May 23 19:15:57 2006
New Revision: 409037

URL: http://svn.apache.org/viewvc?rev=409037&view=rev
Log:
DERBY-847: Internationalize NetIndoubtTransaction to NetSqlca 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/BatchUpdateException.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/CloseFilterInputStream.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/DateTime.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/Decimal.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/SqlException.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/Utils.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/Version.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/NetConnectionReply.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetPackageReply.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetPackageRequest.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSetReply.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSetRequest.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/tools/testing/i18nTestGenerator/genClient2.sed

Modified: db/derby/code/trunk/java/build/org/apache/derbyBuild/splitmessages.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/build/org/apache/derbyBuild/splitmessages.java?rev=409037&r1=409036&r2=409037&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 23 19:15:57
2006
@@ -105,6 +105,8 @@
         clientMessageIds.add(SQLState.DRDA_COMMAND_NOT_IMPLEMENTED);
         clientMessageIds.add(SQLState.JDBC_DRIVER_REGISTER);
         clientMessageIds.add(SQLState.NO_CURRENT_ROW);
+        clientMessageIds.add(SQLState.LANG_IDENTIFIER_TOO_LONG);
+        clientMessageIds.add(SQLState.DRDA_CURSOR_NOT_OPEN);
         clientMessageIds.add(SQLState.PROPERTY_UNSUPPORTED_CHANGE);
         clientMessageIds.add(SQLState.NET_INVALID_JDBC_TYPE_FOR_PARAM);
         clientMessageIds.add(SQLState.UNRECOGNIZED_JAVA_SQL_TYPE);

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/BatchUpdateException.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/BatchUpdateException.java?rev=409037&r1=409036&r2=409037&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/BatchUpdateException.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/BatchUpdateException.java Tue
May 23 19:15:57 2006
@@ -33,7 +33,7 @@
      *  shared message bundle.
      */
     private static MessageUtil msgutil_ = 
-        new MessageUtil(SqlException.CLIENT_MESSAGE_RESOURCE_NAME);
+        SqlException.getMessageUtil();
 
     public BatchUpdateException(LogWriter logWriter, ClientMessageId msgid,
         Object[] args, int[] updateCounts)

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/CloseFilterInputStream.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/CloseFilterInputStream.java?rev=409037&r1=409036&r2=409037&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/CloseFilterInputStream.java
(original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/CloseFilterInputStream.java
Tue May 23 19:15:57 2006
@@ -25,12 +25,13 @@
 
 import java.io.IOException;
 import org.apache.derby.shared.common.i18n.MessageUtil;
+import org.apache.derby.shared.common.reference.MessageId;
 
 class CloseFilterInputStream extends FilterInputStream {
 	
 	private static final String ALREADY_CLOSED_ERR_MESSAGE = 
-        MessageUtil.getCompleteMessage("J104",
-            SqlException.CLIENT_MESSAGE_RESOURCE_NAME, (Object[]) null);
+            SqlException.getMessageUtil().getTextMessage(
+                MessageId.CONN_ALREADY_CLOSED);
 	
 	private boolean closed;
 	

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/DateTime.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/DateTime.java?rev=409037&r1=409036&r2=409037&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/DateTime.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/DateTime.java Tue May 23 19:15:57
2006
@@ -77,9 +77,8 @@
             dayIndx = 8;
         } else {
             throw new java.lang.IllegalArgumentException(
-                MessageUtil.getCompleteMessage(SQLState.LANG_FORMAT_EXCEPTION,
-                    SqlException.CLIENT_MESSAGE_RESOURCE_NAME,
-                    (Object[])null));
+                SqlException.getMessageUtil().getTextMessage(
+                    SQLState.LANG_FORMAT_EXCEPTION));
         }
 
         int zeroBase = ((int) '0');

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/Decimal.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/Decimal.java?rev=409037&r1=409036&r2=409037&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/Decimal.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/Decimal.java Tue May 23 19:15:57
2006
@@ -32,8 +32,7 @@
      */
     public final static int PACKED_DECIMAL = 0x30;
     
-    private static MessageUtil msgutil = new MessageUtil(
-        SqlException.CLIENT_MESSAGE_RESOURCE_NAME);
+    private static MessageUtil msgutil = SqlException.getMessageUtil();
 
     //--------------------------private constants---------------------------------
 

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/SqlException.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/SqlException.java?rev=409037&r1=409036&r2=409037&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 23
19:15:57 2006
@@ -103,8 +103,27 @@
      *  it knows to look there if the message isn't found in the
      *  shared message bundle.
      */
-    private static MessageUtil msgutil_ = 
-        new MessageUtil(CLIENT_MESSAGE_RESOURCE_NAME);
+    private static MessageUtil msgutil_;
+    
+    /**
+     * This routine provides singleton access to an instance of MessageUtil
+     * that is constructed for client messages.  It is recommended to use
+     * this singleton rather than create your own instance.
+     *
+     * The only time you need this instance is if you need to directly
+     * format an internationalized message string.  In most instances this
+     * is done for you when you invoke a SqlException constructor
+     *
+     * @return a singleton instance of MessageUtil configured for client
+     *   messages
+     */
+    public static MessageUtil getMessageUtil() {
+        if ( msgutil_ == null ) {
+            msgutil_ = new MessageUtil(CLIENT_MESSAGE_RESOURCE_NAME);
+        }
+        
+        return msgutil_;
+    }
 
     /** 
      * The wrapped SQLException, if one exists
@@ -115,12 +134,44 @@
     // New constructors that support internationalized messages
     // The message id is wrapped inside a class so that we can distinguish
     // between the signatures of the new constructors and the old constructors
+    
+    /**
+     * Create a SqlException.  This constructor is the "base" constructor;
+     * all other constructors (which take a ClientMessageId) delegate to this
+     * constructor
+     *
+     * @param logwriter
+     *      Can be null, but if provided, it is used to log this exception
+     *
+     * @param msgid
+     *      The message id for this message.  ClientMessageId is a simple type-safe
+     *      wrapper for org.apache.derby.shared.common.reference.SQLState message id
+     *      strings.
+     *
+     * @param args
+     *      The set of substitution arguments for the message.  The Java message
+     *      formatter will substitute these arguments into the internationalized
+     *      strings using the substitution ({0}, {1}, etc.) markers in the string.
+     *      Any object can be passed, but if you want it to be readable, make sure
+     *      toString() for the object returns something useful.
+     *
+     * @param cause
+     *      Can be null.  Indicates the cause of this exception.  If this is
+     *      an instance of SqlException or java.sql.SQLException then the exception
+     *      is chained into the nextException chain.  Otherwise it is chained
+     *      using initCause().  On JDK 1.3, since initCause() does not exist,
+     *      a non-SQL exception can not be chained.  Instead, the exception class
+     *      and message text is appended to the message for this exception.
+     *
+     * @return 
+     *      An instance of SqlException that you can throw to your heart's content.
+     */
     public SqlException(LogWriter logwriter, 
         ClientMessageId msgid, Object[] args, Throwable cause)
     {
         this(
             logwriter,
-            msgutil_.getCompleteMessage(
+            getMessageUtil().getCompleteMessage(
                 msgid.msgid,
                 args),
             ExceptionUtil.getSQLStateFromIdentifier(msgid.msgid),
@@ -130,17 +181,15 @@
             this.setThrowable(cause);
         }
     }
-    
-    /**
-     * Use this to override the standard error code that is derived
-     * from the message severity
-     */
+
+    // Use the following SQLExceptions when you want to override the error
+    // code that is derived from the severity of the message id.
     public SqlException(LogWriter logWriter, ClientMessageId msgid, Object[] 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);
@@ -160,6 +209,10 @@
         this(logWriter, msgid, new Object[] {arg1, arg2}, sqlcode);
     }
  
+    // The following constructors are all wrappers around the base constructor,
+    // created to make it easy to code against them (you don't have to pass
+    // null arguments or construct object arrays).  See the javadoc for the
+    // "base" constructor for an explanation of the parameters
     public SqlException (LogWriter logwriter, 
             ClientMessageId msgid, Throwable cause) {
         this (logwriter, msgid, (Object[])null, cause);
@@ -260,7 +313,7 @@
             if (JVMInfo.JDK_ID < JVMInfo.J2SE_14 )
             {
                 causeString_ = " " + 
-                    msgutil_.getTextMessage(CAUSED_BY_EXCEPTION_ID)  + " " +
+                    getMessageUtil().getTextMessage(CAUSED_BY_EXCEPTION_ID)  + " " +
                     throwable.getClass() + ": " + throwable.getMessage();
             }
             else
@@ -283,7 +336,8 @@
     }
             
     // Constructors for backward-compatibility while we're internationalizng
-    // all the messages
+    // all the messages.  These should be removed once internationalization is
+    // complete
     public SqlException(LogWriter logWriter) {
         if (logWriter != null) {
             logWriter.traceDiagnosable(this);
@@ -366,7 +420,7 @@
     // when getMessage() is called.
     // Called by the Agent.
     void setBatchPositionLabel(int index) {
-        batchPositionLabel_ = msgutil_.getTextMessage(BATCH_POSITION_ID) + 
+        batchPositionLabel_ = getMessageUtil().getTextMessage(BATCH_POSITION_ID) + 
             index + ": ";
     }
 

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/Utils.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/Utils.java?rev=409037&r1=409036&r2=409037&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/Utils.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/Utils.java Tue May 23 19:15:57
2006
@@ -23,6 +23,7 @@
 import java.sql.SQLException;
 import org.apache.derby.iapi.types.SQLBit;
 import org.apache.derby.shared.common.i18n.MessageUtil;
+import org.apache.derby.shared.common.reference.MessageId;
 
 // Self-contained utilities.
 // Don't reference any other driver classes, except Configuration, from within this class.
@@ -83,9 +84,8 @@
 
         if (byteArrayCmp(bBytes, tenRadixArr[tenRadixArr.length - 1]) >= 0) {
             throw new java.lang.IllegalArgumentException(
-                MessageUtil.getCompleteMessage("J105",
-                    SqlException.CLIENT_MESSAGE_RESOURCE_NAME,
-                    (Object[])null));
+                SqlException.getMessageUtil().
+                    getTextMessage(MessageId.CONN_PRECISION_TOO_LARGE));
         }
 
         int lo = 0, hi = tenRadixArr.length - 1, mi = (hi + lo) / 2;

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/Version.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/Version.java?rev=409037&r1=409036&r2=409037&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/Version.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/Version.java Tue May 23 19:15:57
2006
@@ -25,8 +25,7 @@
 
 
 public abstract class Version {
-    static MessageUtil msgutil = 
-        new MessageUtil(SqlException.CLIENT_MESSAGE_RESOURCE_NAME);
+    static MessageUtil msgutil = SqlException.getMessageUtil();
     
     // Constants for internationalized message ids
     private static String SECURITY_MANAGER_NO_ACCESS_ID             = "J108";

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection.java?rev=409037&r1=409036&r2=409037&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
23 19:15:57 2006
@@ -42,8 +42,7 @@
 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 static MessageUtil msgutil = SqlException.getMessageUtil();
 
     protected NetAgent netAgent_;
     //contains a reference to the PooledConnection from which this created 

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnectionReply.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnectionReply.java?rev=409037&r1=409036&r2=409037&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 23 19:15:57 2006
@@ -37,8 +37,7 @@
 
 public class NetConnectionReply extends Reply
         implements ConnectionReplyInterface {
-    private static MessageUtil msgutil_
-        = new MessageUtil(SqlException.CLIENT_MESSAGE_RESOURCE_NAME);
+    private static MessageUtil msgutil_ = SqlException.getMessageUtil();
     
     NetConnectionReply(NetAgent netAgent, int bufferSize) {
         super(netAgent, bufferSize);

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetPackageReply.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetPackageReply.java?rev=409037&r1=409036&r2=409037&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetPackageReply.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetPackageReply.java Tue May
23 19:15:57 2006
@@ -21,6 +21,8 @@
 package org.apache.derby.client.net;
 
 import org.apache.derby.client.am.DisconnectException;
+import org.apache.derby.client.am.ClientMessageId;
+import org.apache.derby.shared.common.reference.SQLState;
 
 public class NetPackageReply extends NetConnectionReply {
     NetPackageReply(NetAgent netAgent, int bufferSize) {
@@ -204,7 +206,8 @@
             return null;
         }
         agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_,
-                "parsePKGNAMCT not yet implemented"));
+                new ClientMessageId(SQLState.DRDA_COMMAND_NOT_IMPLEMENTED),
+                "parsePKGNAMCT"));
         return null; // to make compiler happy
     }
 }

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetPackageRequest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetPackageRequest.java?rev=409037&r1=409036&r2=409037&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetPackageRequest.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetPackageRequest.java Tue
May 23 19:15:57 2006
@@ -22,6 +22,8 @@
 import org.apache.derby.client.am.Configuration;
 import org.apache.derby.client.am.Section;
 import org.apache.derby.client.am.SqlException;
+import org.apache.derby.client.am.ClientMessageId;
+import org.apache.derby.shared.common.reference.SQLState;
 
 
 public class NetPackageRequest extends NetConnectionRequest {
@@ -166,8 +168,9 @@
                                        int lengthRequiringScldta) throws SqlException {
         int length = identifier.length();
         if (length > maxIdentifierLength) {
-            throw new SqlException(netAgent_.logWriter_, "" + identifier + " exceeds maximum
identifier length of ' " +
-                    maxIdentifierLength + "'");
+            throw new SqlException(netAgent_.logWriter_,
+                new ClientMessageId(SQLState.LANG_IDENTIFIER_TOO_LONG),
+                identifier, new Integer(maxIdentifierLength));
         }
 
         return (length > lengthRequiringScldta);
@@ -177,7 +180,9 @@
         try {
             return string.getBytes(encoding);
         } catch (java.lang.Exception e) {
-            throw new SqlException(netAgent_.logWriter_, e, "error on getBytes");
+            throw new SqlException(netAgent_.logWriter_, 
+                new ClientMessageId(SQLState.JAVA_EXCEPTION), 
+                e.getClass().getName(), e.getMessage(), e);
         }
     }
 

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSetReply.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSetReply.java?rev=409037&r1=409036&r2=409037&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSetReply.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSetReply.java Tue
May 23 19:15:57 2006
@@ -24,7 +24,10 @@
 import org.apache.derby.client.am.ResultSet;
 import org.apache.derby.client.am.ResultSetCallbackInterface;
 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.shared.common.reference.SQLState;
+import org.apache.derby.shared.common.reference.MessageId;
 
 public class NetResultSetReply extends NetStatementReply implements ResultSetReplyInterface
{
     public NetResultSetReply(NetAgent netAgent, int bufferSize) {
@@ -325,14 +328,12 @@
         netAgent_.setSvrcod(svrcod);
         if (svrcod == CodePoint.SVRCOD_WARNING) {
             netAgent_.accumulateReadException(new SqlException(netAgent_.logWriter_,
-                    "The identified cursor is not open.",
-                    SqlState._24501));
+                new ClientMessageId(SQLState.DRDA_CURSOR_NOT_OPEN)));
         } else {
             agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_,
-                    "Execution failed due to a distribution protocol error that " +
-                    "caused deallocation of the conversation.  " +
-                    "The identified cursor is not open.",
-                    SqlState._58009));
+                new ClientMessageId(SQLState.DRDA_CONNECTION_TERMINATED),
+                    SqlException.getMessageUtil().
+                    getTextMessage(MessageId.CONN_CURSOR_NOT_OPEN)));
         }
     }
 }

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSetRequest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSetRequest.java?rev=409037&r1=409036&r2=409037&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSetRequest.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSetRequest.java Tue
May 23 19:15:57 2006
@@ -24,6 +24,9 @@
 import org.apache.derby.client.am.ResultSet;
 import org.apache.derby.client.am.Section;
 import org.apache.derby.client.am.SqlException;
+import org.apache.derby.client.am.ClientMessageId;
+
+import org.apache.derby.shared.common.reference.SQLState;
 
 public class NetResultSetRequest extends NetStatementRequest
         implements ResultSetRequestInterface {
@@ -312,7 +315,8 @@
             return CodePoint.QRYSCRREL;
 
         default:
-            throw new SqlException(netAgent_.logWriter_, "Bug check: invalid scroll orientation");
+            throw new SqlException(netAgent_.logWriter_, 
+                new ClientMessageId(SQLState.NET_INVALID_SCROLL_ORIENTATION));
         }
     }
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties?rev=409037&r1=409036&r2=409037&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 23
19:15:57 2006
@@ -259,8 +259,10 @@
 40XT7=Operation is not supported in an internal transaction.
 
 #
-# 57,58 - DRDA errors with SQLStates required by the spec
-
+# 2D, 24, 57,58 - DRDA errors with SQLStates required by the spec
+2D521.S.1=setAutoCommit(true) invalid during global transaction.
+2D521.S.2=COMMIT or ROLLBACK invalid for application execution environment. 
+24501.S=The identified cursor is not open.
 # 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
@@ -1224,16 +1226,14 @@
 #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.
 XN009.S=Error obtaining length of BLOB/CLOB object, exception follows.
 XN010.S=Procedure name can not be null.
 XN011.S=Procedure name length {0} is not within the valid range of 1 to {1}.
 XN012.S=On {0} platforms, XA supports version {1} and above, this is version {2}
+XN013.S=Invalid scroll orientation.
+
+
 
 
 # 0A - SQLState class indicating feature not supported
@@ -1280,6 +1280,11 @@
 08001.C.6=Password length ({0}) is outside the range of 1 to {1}.
 08001.C.7=User id can not be null.
 08001.C.8=Password can not be null.
+08001.C.9=A connection could not be established because the database name ''{0}'' is larger
than the maximum length allowed by the network protocol.
+08001.C.10=A connection could not be established because the security token is larger than
the maximum allowed by the network protocol.
+08001.C.11=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.
+08001.C.12=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.
+
 
 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.
@@ -1292,6 +1297,7 @@
 08006.C.8=Network protocol exception: scldta length, {0}, is invalid for pkgid.  The connection
has been terminated.
 08006.C.9=Network protocol exception: PKGNAMCSN length, {0}, is invalid at SQLAM {1}.  The
connection has been terminated.
 08006.C.10=Network protocol exception: only one of the VCM, VCS length can be greater than
0.  The connection has been terminated.
+08006.C.11=The connection was terminated because the encoding is not supported.
 
 
 
@@ -1316,9 +1322,7 @@
 XJ001.U=Java exception: ''{1}: {0}''.
 XJ050.U=Database requires upgrade from version {0}, set the attribute ''upgrade=true'' on
the JDBC connection URL to allow upgrade to version {1}.
 
-# 2D - DRDA exceptions
-2D521.S.1=setAutoCommit(true) invalid during global transaction.
-2D521.S.2=COMMIT or ROLLBACK invalid for application execution environment.
+
 
 # org.apache.derby.database.UserUtility
 #
@@ -1430,8 +1434,10 @@
 J125=a Data Descriptor Mismatch Error was detected.
 J126=a conversational protocol error was detected.  Reason: 0x{0}.
 J127=parseSQLDIAGGRP is not yet implemented
-J128=an Open Query command was issued for a query which was already open
-J129=A PROTOCOL Invalid FDOCA Description Error was detected
+J128=the cursor is not open
+J129=an Open Query command was issued for a query which was already open
+J130=A PROTOCOL Invalid FDOCA Description Error was detected
+J140=A PROTOCOL Data Stream Syntax Error was detected.  Reason: 0x{0}.
 
 
 # Authentication

Modified: db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/MessageId.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/MessageId.java?rev=409037&r1=409036&r2=409037&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 23 19:15:57 2006
@@ -125,24 +125,29 @@
     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";
-    String CONN_DRDA_QRYOPEN                = "J127";
-    String CONN_DRDA_INVALIDFDOCA           = "J128";
+    String CONN_ALREADY_CLOSED                              = "J104";
+    String CONN_PRECISION_TOO_LARGE                         = "J105";
+    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";
+    String CONN_PARSE_SQLDIAGGRP_NOT_IMPLEMENTED            = "J127";
+    String CONN_CURSOR_NOT_OPEN                             = "J128";
+    String CONN_DRDA_QRYOPEN                                = "J129";
+    String CONN_DRDA_INVALIDFDOCA                           = "J130";
+    String CONN_DRDA_DATASTREAM_SYNTAX_ERROR                = "J131";
 
 	/*
 	** Authentication

Modified: db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java?rev=409037&r1=409036&r2=409037&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 23 19:15:57 2006
@@ -1520,16 +1520,12 @@
     //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";
     String NET_ERROR_GETTING_BLOB_LENGTH                            = "XN009.S";
     String NET_NULL_PROCEDURE_NAME                                  = "XN010.S";
     String NET_PROCEDURE_NAME_LENGTH_OUT_OF_RANGE                   = "XN011.S";
     String NET_WRONG_XA_VERSION                                     = "XN012.S";
+    String NET_INVALID_SCROLL_ORIENTATION                           = "XN013.S";
     
     // Used by server for scrollable updatable insensitive result sets
     // to transmit updated state to client. Internal, not seen by user.
@@ -1587,6 +1583,8 @@
     String NET_SQLCDTA_INVALID_FOR_PKGID                        = "08006.C.8";
     String NET_PGNAMCSN_INVALID_AT_SQLAM                        = "08006.C.9";
     String NET_VCM_VCS_LENGTHS_INVALID                          = "08006.C.10";
+    String NET_ENCODING_NOT_SUPPORTED                           = "08006.C.11";
+
 
     
     // 08001 is specifically about the SQL client not being able to establish
@@ -1606,6 +1604,10 @@
     String CONNECT_PASSWORD_LENGTH_OUT_OF_RANGE                 = "08001.C.6";
     String CONNECT_USERID_ISNULL                                = "08001.C.7";
     String CONNECT_PASSWORD_ISNULL                              = "08001.C.8";
+    String NET_DBNAME_TOO_LONG                                  = "08001.C.9";
+    String NET_SECTKN_TOO_LONG                                  = "08001.C.10";
+    String NET_USERID_TOO_LONG                                  = "08001.C.11";
+    String NET_PASSWORD_TOO_LONG                                = "08001.C.12";
 
         
     // system severity
@@ -1651,6 +1653,7 @@
      */
     String DRDA_NO_AUTOCOMMIT_UNDER_XA                              = "2D521.S.1";
     String DRDA_INVALID_XA_STATE_ON_COMMIT_OR_ROLLBACK              = "2D521.S.2"; 
+    String DRDA_CURSOR_NOT_OPEN                                     = "24501.S";
     String DRDA_CONNECTION_TERMINATED                               = "58009.C";
     String DRDA_MGRLVLRM                                            = "58010.C";
     String DRDA_DDM_COMMAND_NOT_SUPPORTED                           = "58014.C";

Modified: db/derby/code/trunk/tools/testing/i18nTestGenerator/genClient2.sed
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/tools/testing/i18nTestGenerator/genClient2.sed?rev=409037&r1=409036&r2=409037&view=diff
==============================================================================
--- db/derby/code/trunk/tools/testing/i18nTestGenerator/genClient2.sed (original)
+++ db/derby/code/trunk/tools/testing/i18nTestGenerator/genClient2.sed Tue May 23 19:15:57
2006
@@ -89,6 +89,8 @@
 s/[[:space:]]fp\.getFirstValue()/ "string"/g
 s/,uee/,testException/g
 s/[[:space:]]platform/ "string"/g
+s/parsePKGNAMCT"))/parsePKGNAMCT")/
+s/[[:space:]]identifier/ "string"/g
 
 
 



Mime
View raw message