db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davi...@apache.org
Subject svn commit: r390536 [1/12] - in /db/derby/code/trunk: java/build/org/apache/derbyBuild/ java/client/org/apache/derby/client/am/ java/client/org/apache/derby/loc/ java/engine/org/apache/derby/loc/ java/shared/org/apache/derby/shared/common/reference/ ja...
Date Fri, 31 Mar 2006 23:06:37 GMT
Author: davidvc
Date: Fri Mar 31 15:06:34 2006
New Revision: 390536

URL: http://svn.apache.org/viewcvs?rev=390536&view=rev
Log:
DERBY-842 (Partial) : Internationalized a few more classes.  Also added
a helpful debug method to Types.java that allows you to get a String
name for a given type id.  

derbyall passes for jdk14. Also made sure output files that had
diffs were tested for jdk13 and jdk16, and fixed output files there
as well.  Also scanned the matching embedded output files to verify
that the SQL States were the same where it made sense, and fixed a couple
of bugs there.  


Modified:
    db/derby/code/trunk/java/build/org/apache/derbyBuild/splitmessages.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/ClobWriter.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/Configuration.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/CrossConverters.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/Cursor.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/Types.java
    db/derby/code/trunk/java/client/org/apache/derby/loc/clientmessages_en.properties
    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/SQLState.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/LOBTest.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/blobclob4BLOB.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk14/LOBTest.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk14/parameterMapping.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk14/updatableResultSet.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/LOBTest.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/blobclob4BLOB.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/parameterMapping.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/resultset.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/updatableResultSet.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/parameterMapping.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/updatableResultSet.out
    db/derby/code/trunk/tools/testing/i18nTestGenerator/clientPrologue.txt
    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=390536&r1=390535&r2=390536&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 Fri Mar 31 15:06:34 2006
@@ -54,6 +54,13 @@
         clientMessageIds.add(SQLState.NOT_IMPLEMENTED);
         clientMessageIds.add(SQLState.CANNOT_CLOSE_ACTIVE_CONNECTION);
         clientMessageIds.add(SQLState.XACT_SAVEPOINT_RELEASE_ROLLBACK_FAIL);
+        clientMessageIds.add(SQLState.UNSUPPORTED_ENCODING);
+        clientMessageIds.add(SQLState.LANG_FORMAT_EXCEPTION);
+        clientMessageIds.add(SQLState.LANG_DATA_TYPE_GET_MISMATCH);
+        clientMessageIds.add(SQLState.LANG_DATA_TYPE_SET_MISMATCH);
+        clientMessageIds.add(SQLState.LANG_DATE_SYNTAX_EXCEPTION);
+        clientMessageIds.add(SQLState.CHARACTER_CONVERTER_NOT_AVAILABLE);
+        clientMessageIds.add(SQLState.LANG_OUTSIDE_RANGE_FOR_DATATYPE);
     }
 
 	public static void main(String[] args) throws Exception {

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/ClobWriter.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/am/ClobWriter.java?rev=390536&r1=390535&r2=390536&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/ClobWriter.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/ClobWriter.java Fri Mar 31 15:06:34 2006
@@ -20,6 +20,8 @@
 
 package org.apache.derby.client.am;
 
+import org.apache.derby.shared.common.reference.SQLState;
+
 
 public class ClobWriter extends java.io.Writer {
     private Clob clob_;
@@ -33,7 +35,9 @@
         offset_ = offset;
 
         if (offset_ - 1 > clob_.sqlLength_) {
-            throw new SqlException(clob_.agent_.logWriter_, "Invalid position: " + offset);
+            throw new SqlException(clob_.agent_.logWriter_, 
+                new MessageId(SQLState.BLOB_BAD_POSITION),
+                new Long(offset));
         }
     }
 

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/Configuration.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/am/Configuration.java?rev=390536&r1=390535&r2=390536&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/Configuration.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/Configuration.java Fri Mar 31 15:06:34 2006
@@ -27,7 +27,9 @@
 
 import org.apache.derby.iapi.services.info.ProductGenusNames;
 import org.apache.derby.iapi.services.info.ProductVersionHolder;
+import org.apache.derby.shared.common.reference.SQLState;
 import org.apache.derby.iapi.services.info.JVMInfo;
+
 public class Configuration {
 
 
@@ -171,25 +173,23 @@
         try {
             dncResources__ = (java.util.ResourceBundle) java.security.AccessController.doPrivileged(new org.apache.derby.client.am.GetResourceBundleAction(classNameForResources));
         } catch (java.security.PrivilegedActionException e) {
-            throw new SqlException(null,
-                    "[derby] " +
-                    "PrivilegedActionException:" +
-                    e.getException());
+            throw new SqlException(null, 
+                    new MessageId (SQLState.ERROR_PRIVILEGED_ACTION),
+                    e.getException());                    
         } catch (java.util.MissingResourceException e) {
             // A null log writer is passed, because jdbc 1 sql exceptions are automatically traced
             throw new SqlException(null,
-                    "[derby] " +
-                    "Missing resource bundle:" +
-                    " a resource bundle could not be found" +
-                    " in the " + packageNameForDNC + " package for " + Configuration.dncDriverName);
+                    new MessageId (SQLState.MISSING_RESOURCE_BUNDLE),
+                    packageNameForDNC, Configuration.dncDriverName);
         }
     }
 
     public static void checkForExceptionsFromLoadConfiguration(LogWriter dncLogWriter) throws SqlException {
         if (dncResources__ == null) {
-            throw new SqlException(dncLogWriter,
-                    "Missing resource bundle: a resource bundle could not be found" +
-                    " in the " + Configuration.packageNameForDNC + " package for " + Configuration.dncDriverName);
+             throw new SqlException(null,
+                    new MessageId (SQLState.MISSING_RESOURCE_BUNDLE),
+                    Configuration.packageNameForDNC, 
+                     Configuration.dncDriverName);            
         }
     }
 
@@ -200,15 +200,11 @@
         try {
             dncProductVersionHolder__ = buildProductVersionHolder();
         } catch (java.security.PrivilegedActionException e) {
-            throw new SqlException(null,
-                    "[derby] " +
-                    "PrivilegedActionException:" +
-                    e.getException());
+            throw new SqlException(null, 
+                    new MessageId (SQLState.ERROR_PRIVILEGED_ACTION),
+                    e.getException());                    
         } catch (java.io.IOException ioe) {
-            throw new SqlException(null,
-                    "[derby] " +
-                    "IOException:" +
-                    ioe);
+            throw new SqlException(null, ioe, null);
         }
     }
 

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/CrossConverters.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/am/CrossConverters.java?rev=390536&r1=390535&r2=390536&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/CrossConverters.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/CrossConverters.java Fri Mar 31 15:06:34 2006
@@ -20,6 +20,8 @@
 
 package org.apache.derby.client.am;
 
+import org.apache.derby.shared.common.reference.SQLState;
+
 // All currently supported derby types are mapped to one of the following jdbc types:
 // java.sql.Types.SMALLINT;
 // java.sql.Types.INTEGER;
@@ -124,7 +126,9 @@
             return String.valueOf(source);
 
         default:
-            throw new SqlException(agent_.logWriter_, "Illegal Conversion");
+            throw new SqlException(agent_.logWriter_, 
+                new MessageId (SQLState.LANG_DATA_TYPE_SET_MISMATCH),
+                "byte", Types.getTypeString(targetType));
         }
     }
 
@@ -160,7 +164,9 @@
             return String.valueOf(source);
 
         default:
-            throw new SqlException(agent_.logWriter_, "Illegal Conversion");
+            throw new SqlException(agent_.logWriter_, 
+                new MessageId (SQLState.LANG_DATA_TYPE_SET_MISMATCH),
+                    "int", Types.getTypeString(targetType));
         }
     }
 
@@ -185,7 +191,8 @@
         case Types.LONGVARCHAR:
             return getBooleanFromString((String) source);
         default:
-            throw new ColumnTypeConversionException(agent_.logWriter_);
+            throw new ColumnTypeConversionException(agent_.logWriter_,
+                Types.getTypeString(sourceType), "boolean");
         }
     }
 
@@ -210,7 +217,8 @@
         case Types.LONGVARCHAR:
             return getByteFromString((String) source);
         default:
-            throw new ColumnTypeConversionException(agent_.logWriter_);
+            throw new ColumnTypeConversionException(agent_.logWriter_,
+                Types.getTypeString(sourceType), "byte");
         }
     }
 
@@ -250,7 +258,9 @@
             return String.valueOf(source);
 
         default:
-            throw new SqlException(agent_.logWriter_, "Illegal Conversion");
+            throw new SqlException(agent_.logWriter_, 
+                new MessageId (SQLState.LANG_DATA_TYPE_SET_MISMATCH),
+                "long", Types.getTypeString(targetType));
         }
     }
 
@@ -323,7 +333,9 @@
             return String.valueOf(source);
 
         default:
-            throw new SqlException(agent_.logWriter_, "Illegal Conversion");
+            throw new SqlException(agent_.logWriter_, 
+                new MessageId (SQLState.LANG_DATA_TYPE_SET_MISMATCH),
+                "float", Types.getTypeString(targetType));
         }
     }
 
@@ -384,7 +396,9 @@
             return String.valueOf(source);
 
         default:
-            throw new SqlException(agent_.logWriter_, "Illegal Conversion");
+            throw new SqlException(agent_.logWriter_, 
+                new MessageId (SQLState.LANG_DATA_TYPE_SET_MISMATCH),
+                "double", Types.getTypeString(targetType));
         }
     }
 
@@ -436,7 +450,9 @@
             return String.valueOf(source);
 
         default:
-            throw new SqlException(agent_.logWriter_, "Illegal Conversion");
+            throw new SqlException(agent_.logWriter_, 
+                new MessageId (SQLState.LANG_DATA_TYPE_SET_MISMATCH),
+                "java.Math.BigDecimal", Types.getTypeString(targetType));
         }
     }
 
@@ -457,7 +473,9 @@
             return String.valueOf(source);
 
         default:
-            throw new SqlException(agent_.logWriter_, "Illegal Conversion");
+            throw new SqlException(agent_.logWriter_, 
+                new MessageId (SQLState.LANG_DATA_TYPE_SET_MISMATCH),
+                "java.sql.Date", Types.getTypeString(targetType));
         }
     }
 
@@ -475,7 +493,9 @@
             return String.valueOf(source);
 
         default:
-            throw new SqlException(agent_.logWriter_, "Illegal Conversion");
+            throw new SqlException(agent_.logWriter_, 
+                new MessageId (SQLState.LANG_DATA_TYPE_SET_MISMATCH),
+                "java.sql.Time", Types.getTypeString(targetType));
         }
     }
 
@@ -499,7 +519,9 @@
             return String.valueOf(source);
 
         default:
-            throw new SqlException(agent_.logWriter_, "Illegal Conversion");
+            throw new SqlException(agent_.logWriter_, 
+                new MessageId (SQLState.LANG_DATA_TYPE_SET_MISMATCH),
+                "java.sql.Timestamp", Types.getTypeString(targetType));
         }
     }
 
@@ -552,15 +574,16 @@
             case Types.LONGVARBINARY:
             case Types.BLOB:
             default:
-                throw new SqlException(agent_.logWriter_, "Illegal Conversion");
+            throw new SqlException(agent_.logWriter_, 
+                new MessageId (SQLState.LANG_DATA_TYPE_SET_MISMATCH),
+                "String", Types.getTypeString(targetDriverType));
             }
         } catch (java.lang.NumberFormatException e) {
-            throw new SqlException(agent_.logWriter_,
-                    e,
-                    "Invalid data conversion:"
-                    + " Parameter instance "
-                    + source
-                    + " is invalid for requested conversion.");
+            throw new SqlException(agent_.logWriter_, 
+                    new MessageId 
+                    (SQLState.LANG_FORMAT_EXCEPTION), 
+                    Types.getTypeString(targetDriverType),
+                    e);                    
         }
     }
 
@@ -600,7 +623,9 @@
         case Types.BLOB:
             return new Blob(source, agent_, 0);
         default:
-            throw new SqlException(agent_.logWriter_, "Illegal Conversion");
+            throw new SqlException(agent_.logWriter_, 
+                new MessageId (SQLState.LANG_DATA_TYPE_SET_MISMATCH),
+                "byte[]", Types.getTypeString(targetType));
         }
     }
 
@@ -621,7 +646,9 @@
         case Types.LONGVARBINARY:
         case Types.BLOB:
         default:
-            throw new SqlException(agent_.logWriter_, "Illegal Conversion");
+            throw new SqlException(agent_.logWriter_, 
+                new MessageId (SQLState.LANG_DATA_TYPE_SET_MISMATCH),
+                "java.io.Reader", Types.getTypeString(targetType));
         }
     }
 
@@ -637,11 +664,12 @@
                 read = r.read();
             }
             if (length != totalRead) {
-                throw new SqlException(agent_.logWriter_, "The Reader object does not contain length characters");
+                throw new SqlException(agent_.logWriter_, 
+                		new MessageId (SQLState.READER_UNDER_RUN));
             }
             return sw.toString();
         } catch (java.io.IOException e) {
-            throw new SqlException(agent_.logWriter_, e.getMessage());
+            throw SqlException.javaException(agent_.logWriter_, e);
         }
     }
 
@@ -661,7 +689,9 @@
         case Types.LONGVARBINARY:
         case Types.BLOB:
         default:
-            throw new SqlException(agent_.logWriter_, "Illegal Conversion");
+            throw new SqlException(agent_.logWriter_, 
+                new MessageId (SQLState.LANG_DATA_TYPE_SET_MISMATCH),
+                "java.io.InputStream", Types.getTypeString(targetType));
         }
     }
 
@@ -680,16 +710,19 @@
                     read = is.read();
                 }
             } catch (java.io.IOException e) {
-                throw new SqlException(agent_.logWriter_, e.getMessage());
+                throw new SqlException(agent_.logWriter_, e, null);
             }
 
             if (length != totalRead) {
-                throw new SqlException(agent_.logWriter_, "The InputStream object does not contain length bytes");
+                throw new SqlException(agent_.logWriter_, 
+                		new MessageId (SQLState.READER_UNDER_RUN));
             }
 
             return new String(baos.toByteArray(), encoding);
         } catch (java.io.UnsupportedEncodingException e) {
-            throw new SqlException(agent_.logWriter_, e.getMessage());
+            throw new SqlException(agent_.logWriter_,
+                new MessageId (SQLState.UNSUPPORTED_ENCODING), 
+                    "java.io.InputStream", "String", e);
         }
     }
 
@@ -705,10 +738,12 @@
             try {
                 return source.getBytes(1L, (int) source.length());
             } catch (java.sql.SQLException e) {
-                throw new SqlException(agent_.logWriter_, e.getMessage());
+                throw new SqlException(e);                        
             }
         default:
-            throw new SqlException(agent_.logWriter_, "Illegal Conversion");
+            throw new SqlException(agent_.logWriter_, 
+                new MessageId (SQLState.LANG_DATA_TYPE_SET_MISMATCH),
+                "java.sql.Blob", Types.getTypeString(targetType));
         }
     }
 
@@ -723,7 +758,9 @@
         case Types.BLOB:
             return new Blob(agent_, source, length);
         default:
-            throw new SqlException(agent_.logWriter_, "Illegal Conversion");
+            throw new SqlException(agent_.logWriter_, 
+                new MessageId (SQLState.LANG_DATA_TYPE_SET_MISMATCH),
+                "java.io.InputStream", Types.getTypeString(targetType));
         }
     }
 
@@ -741,10 +778,11 @@
             }
 
             if (length != totalRead) {
-                throw new SqlException(agent_.logWriter_, "The InputStream object does not contain length bytes");
+                throw new SqlException(agent_.logWriter_,
+                		new MessageId (SQLState.READER_UNDER_RUN));
             }
         } catch (java.io.IOException e) {
-            throw new SqlException(agent_.logWriter_, e.getMessage());
+            throw new SqlException(agent_.logWriter_, e, null);
         }
         return baos.toByteArray();
     }
@@ -760,7 +798,9 @@
         case Types.LONGVARCHAR:
             return source.toString();
         default:
-            throw new SqlException(agent_.logWriter_, "Illegal Conversion");
+            throw new SqlException(agent_.logWriter_, 
+                new MessageId (SQLState.LANG_DATA_TYPE_SET_MISMATCH),
+                "java.sql.Clob", Types.getTypeString(targetType));
         }
     }
 
@@ -802,9 +842,9 @@
         } else if (source instanceof Byte) {
             return setObject(targetType, ((Byte) source).byteValue());
         } else {
-            throw new SqlException(agent_.logWriter_, "Invalid data conversion:" +
-                    " Parameter instance " + source +
-                    " is invalid for requested conversion.");
+            throw new SqlException(agent_.logWriter_, 
+                new MessageId (SQLState.LANG_DATA_TYPE_SET_MISMATCH),
+                source.getClass().getName(), Types.getTypeString(targetType));
         }
     }
 
@@ -911,9 +951,9 @@
         try {
             return parseByte(source);
         } catch (java.lang.NumberFormatException e) {
-            throw new SqlException(agent_.logWriter_, e, "Invalid data conversion:" +
-                    " Parameter instance " + source +
-                    " is invalid for requested conversion to " + "byte.");
+            throw new SqlException(agent_.logWriter_, 
+            		new MessageId 
+            		(SQLState.LANG_FORMAT_EXCEPTION), "byte", e);
         }
     }
 
@@ -971,9 +1011,10 @@
         try {
             return parseShort(source);
         } catch (java.lang.NumberFormatException e) {
-            throw new SqlException(agent_.logWriter_, e, "Invalid data conversion:" +
-                    " Parameter instance " + source +
-                    " is invalid for requested conversion to " + "short.");
+            throw new SqlException(agent_.logWriter_, 
+            		new MessageId 
+            		(SQLState.LANG_FORMAT_EXCEPTION), 
+            		"short", e);
         }
     }
 
@@ -1022,9 +1063,9 @@
         try {
             return parseInt(source);
         } catch (java.lang.NumberFormatException e) {
-            throw new SqlException(agent_.logWriter_, e, "Invalid data conversion:" +
-                    " Parameter instance " + source +
-                    " is invalid for requested conversion to " + "int.");
+            throw new SqlException(agent_.logWriter_, 
+            		new MessageId (SQLState.LANG_FORMAT_EXCEPTION),
+            		"int", e);
         }
     }
 
@@ -1064,9 +1105,9 @@
         try {
             return parseLong(source);
         } catch (java.lang.NumberFormatException e) {
-            throw new SqlException(agent_.logWriter_, e, "Invalid data conversion:" +
-                    " Parameter instance " + source +
-                    " is invalid for requested conversion to " + "long.");
+            throw new SqlException(agent_.logWriter_, 
+            		new MessageId (SQLState.LANG_FORMAT_EXCEPTION),
+        			"long", e);
         }
     }
 
@@ -1097,9 +1138,9 @@
         try {
             return Float.parseFloat(source.trim());
         } catch (java.lang.NumberFormatException e) {
-            throw new SqlException(agent_.logWriter_, e, "Invalid data conversion:" +
-                    " Parameter instance " + source +
-                    " is invalid for requested conversion to " + "float.");
+            throw new SqlException(agent_.logWriter_, 
+            		new MessageId (SQLState.LANG_FORMAT_EXCEPTION),
+                    "float", e);
         }
     }
 
@@ -1121,9 +1162,9 @@
         try {
             return Double.parseDouble(source.trim());
         } catch (java.lang.NumberFormatException e) {
-            throw new SqlException(agent_.logWriter_, e, "Invalid data conversion:" +
-                    " Parameter instance " + source +
-                    " is invalid for requested conversion to " + "double.");
+            throw new SqlException(agent_.logWriter_, 
+            		new MessageId (SQLState.LANG_FORMAT_EXCEPTION),
+                    "double", e);
         }
     }
 
@@ -1139,9 +1180,9 @@
             // which doesn't like spaces, so we have to call trim() to get rid of the spaces from CHAR columns.
             return new java.math.BigDecimal(source.trim());
         } catch (java.lang.NumberFormatException e) {
-            throw new SqlException(agent_.logWriter_, e, "Invalid data conversion:" +
-                    " Parameter instance " + source +
-                    " is invalid for requested conversion to " + "java.math.BigDecimal.");
+            throw new SqlException(agent_.logWriter_,
+            		new MessageId (SQLState.LANG_FORMAT_EXCEPTION),
+                    "java.math.BigDecimal", e);
         }
     }
 
@@ -1173,9 +1214,8 @@
         try {
             return date_valueOf(source);
         } catch (java.lang.IllegalArgumentException e) { // subsumes NumberFormatException
-            throw new SqlException(agent_.logWriter_, e, "Invalid data conversion:" +
-                    " Parameter instance " + source +
-                    " is invalid for requested conversion to " + "java.sql.Date.");
+            throw new SqlException(agent_.logWriter_, 
+            		new MessageId (SQLState.LANG_DATE_SYNTAX_EXCEPTION), e);
         }
     }
 
@@ -1193,9 +1233,8 @@
         try {
             return time_valueOf(source);
         } catch (java.lang.IllegalArgumentException e) { // subsumes NumberFormatException
-            throw new SqlException(agent_.logWriter_, e, "Invalid data conversion:" +
-                    " Parameter instance " + source +
-                    " is invalid for requested conversion to " + "java.sql.Time.");
+            throw new SqlException(agent_.logWriter_, 
+            		new MessageId (SQLState.LANG_DATE_SYNTAX_EXCEPTION), e);
         }
     }
 
@@ -1209,10 +1248,8 @@
         try {
             return timestamp_valueOf(source);
         } catch (java.lang.IllegalArgumentException e) {  // subsumes NumberFormatException
-            throw new SqlException(agent_.logWriter_, e,
-                    "Invalid data conversion:" +
-                    " Parameter instance " + source +
-                    " is invalid for requested conversion to " + "java.sql.Timestamp.");
+            throw new SqlException(agent_.logWriter_, 
+            		new MessageId (SQLState.LANG_DATE_SYNTAX_EXCEPTION), e);
         }
     }
 

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/Cursor.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/am/Cursor.java?rev=390536&r1=390535&r2=390536&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/Cursor.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/Cursor.java Fri Mar 31 15:06:34 2006
@@ -20,6 +20,7 @@
 
 package org.apache.derby.client.am;
 import org.apache.derby.iapi.reference.JDBC30Translation;
+import org.apache.derby.shared.common.reference.SQLState;
 
 import java.sql.SQLException;
 import java.io.UnsupportedEncodingException;
@@ -360,7 +361,9 @@
                     getColumnPrecision(column - 1),
                     getColumnScale(column - 1));
         } catch (java.io.UnsupportedEncodingException e) {
-            throw new SqlException(agent_.logWriter_, e, "Encoding is unsupported for conversion to BigDecimal");
+            throw new SqlException(agent_.logWriter_, 
+                new MessageId (SQLState.UNSUPPORTED_ENCODING),  
+                "DECIMAL", "java.math.BigDecimal", e);
         }
     }
 
@@ -373,9 +376,13 @@
                     getColumnPrecision(column - 1),
                     getColumnScale(column - 1));
         } catch (java.lang.IllegalArgumentException e) {
-            throw new SqlException(agent_.logWriter_, e, "Decimal value is out of range for conversion to double");
+            throw new SqlException(agent_.logWriter_, 
+                new MessageId (SQLState.LANG_OUTSIDE_RANGE_FOR_DATATYPE),
+                "double", e);
         } catch (java.io.UnsupportedEncodingException e) {
-            throw new SqlException(agent_.logWriter_, e, "Encoding is unsupported for conversion to BigDecimal");
+            throw new SqlException(agent_.logWriter_, 
+                new MessageId (SQLState.UNSUPPORTED_ENCODING), 
+                "DECIMAL", "double", e);
         }
     }
 
@@ -387,9 +394,13 @@
                     getColumnPrecision(column - 1),
                     getColumnScale(column - 1));
         } catch (java.lang.IllegalArgumentException e) {
-            throw new SqlException(agent_.logWriter_, e, "Decimal value is out of range for conversion to long");
+            throw new SqlException(agent_.logWriter_,
+                new MessageId (SQLState.LANG_OUTSIDE_RANGE_FOR_DATATYPE),
+                "long", e);
         } catch (java.io.UnsupportedEncodingException e) {
-            throw new SqlException(agent_.logWriter_, e, "Encoding is unsupported for conversion to BigDecimal");
+            throw new SqlException(agent_.logWriter_,
+                new MessageId (SQLState.UNSUPPORTED_ENCODING), 
+                "DECIMAL", "long", e);
         }
     }
 
@@ -413,7 +424,7 @@
             // byte ccsids.
             if (charsetName_[column - 1] == null) {
                 throw new SqlException(agent_.logWriter_,
-                        "Required character converter not available for data type.");
+                    new MessageId(SQLState.CHARACTER_CONVERTER_NOT_AVAILABLE));
             }
 
             tempString = new String(dataBuffer_,
@@ -423,7 +434,9 @@
             return (maxFieldSize_ == 0) ? tempString :
                     tempString.substring(0, java.lang.Math.min(maxFieldSize_, tempString.length()));
         } catch (java.io.UnsupportedEncodingException e) {
-            throw new SqlException(agent_.logWriter_, e, "unsupported encoding for result set column " + column);
+            throw new SqlException(agent_.logWriter_, 
+            		new MessageId (SQLState.UNSUPPORTED_ENCODING), 
+            		"VARCHAR", "String", e);
         }
     }
 
@@ -442,7 +455,7 @@
             // byte ccsids.
             if (charsetName_[column - 1] == null) {
                 throw new SqlException(agent_.logWriter_,
-                        "Required character converter not available for data type.");
+                    new MessageId(SQLState.CHARACTER_CONVERTER_NOT_AVAILABLE));
             }
 
             tempString = new String(dataBuffer_,
@@ -452,7 +465,9 @@
             return (maxFieldSize_ == 0) ? tempString :
                     tempString.substring(0, java.lang.Math.min(maxFieldSize_, tempString.length()));
         } catch (java.io.UnsupportedEncodingException e) {
-            throw new SqlException(agent_.logWriter_, e, "unsupported encoding for result set column " + column);
+            throw new SqlException(agent_.logWriter_,
+                new MessageId (SQLState.UNSUPPORTED_ENCODING),
+                "CHAR", "String", e);
         }
     }
 
@@ -464,8 +479,9 @@
                 recyclableDate_, 
                 charsetName_[column - 1]);
         }catch (UnsupportedEncodingException e) {
-             throw new SqlException(agent_.logWriter_, e, 
-                    "Encoding is unsupported for conversion to DATE");
+             throw new SqlException(agent_.logWriter_, 
+                 new MessageId(SQLState.UNSUPPORTED_ENCODING),
+                 "DATE", "java.sql.Date", e);
         }
 
         
@@ -479,8 +495,9 @@
                     recyclableTime_,
                     charsetName_[column - 1]);
         } catch (UnsupportedEncodingException e) {
-            throw new SqlException(agent_.logWriter_, e, 
-                    "Encoding is unsupported for conversion to TIME");
+             throw new SqlException(agent_.logWriter_, 
+                 new MessageId(SQLState.UNSUPPORTED_ENCODING),
+                 "TIME", "java.sql.Time", e);
         }
     }
 
@@ -494,8 +511,9 @@
                 recyclableTimestamp_, 
                 charsetName_[column - 1]);
     } catch (java.io.UnsupportedEncodingException e) {
-        throw new SqlException(agent_.logWriter_, e, 
-                "Encoding is unsupported for conversion to TIMESTAMP");
+             throw new SqlException(agent_.logWriter_, 
+                 new MessageId(SQLState.UNSUPPORTED_ENCODING),
+                 "TIMESTAMP", "java.sql.Timestamp", e);
     }
     }
 
@@ -507,8 +525,9 @@
                     recyclableTimestamp_, 
                     charsetName_[column -1]);
         } catch (UnsupportedEncodingException e) {
-              throw new SqlException(agent_.logWriter_, e, 
-                      "Encoding is unsupported for conversion to TIMESTAMP");            
+             throw new SqlException(agent_.logWriter_, 
+                 new MessageId(SQLState.UNSUPPORTED_ENCODING),
+                 "DATE", "java.sql.Timestamp", e);
         }
     }
 
@@ -520,8 +539,9 @@
                     recyclableTimestamp_,
                     charsetName_[column -1]);
         } catch (UnsupportedEncodingException e) {
-            throw new SqlException(agent_.logWriter_, e, 
-                    "Encoding is unsupported for conversion to TIMESTAMP");
+             throw new SqlException(agent_.logWriter_, 
+                 new MessageId(SQLState.UNSUPPORTED_ENCODING),
+                 "TIME", "java.sql.Timestamp", e);
         }
     }
 
@@ -533,8 +553,9 @@
                     recyclableDate_,
                     charsetName_[column -1]);
         } catch (UnsupportedEncodingException e) {
-             throw new SqlException(agent_.logWriter_, e, 
-                     "Encoding is unsupported for conversion to DATE");
+             throw new SqlException(agent_.logWriter_, 
+                 new MessageId(SQLState.UNSUPPORTED_ENCODING),
+                 "TIMESTAMP", "java.sql.Date", e);
         }
     }
 
@@ -546,8 +567,9 @@
                     recyclableTime_,
                     charsetName_[column -1]);
         } catch (UnsupportedEncodingException e) {
-             throw new SqlException(agent_.logWriter_, e, 
-                     "Encoding is unsupported for conversion to TIME");
+             throw new SqlException(agent_.logWriter_, 
+                 new MessageId(SQLState.UNSUPPORTED_ENCODING),
+                 "TIMESTAMP", "java.sql.Time", e);
         }
     }
 
@@ -624,7 +646,8 @@
         case java.sql.Types.LONGVARCHAR:
             return agent_.crossConverters_.getBooleanFromString(getVARCHAR(column));
         default:
-            throw new ColumnTypeConversionException(agent_.logWriter_);
+            throw new ColumnTypeConversionException(agent_.logWriter_,
+                "java.sql.Types " + jdbcTypes_[column -1], "boolean");
         }
     }
 
@@ -652,7 +675,8 @@
         case java.sql.Types.LONGVARCHAR:
             return agent_.crossConverters_.getByteFromString(getVARCHAR(column));
         default:
-            throw new ColumnTypeConversionException(agent_.logWriter_);
+            throw new ColumnTypeConversionException(agent_.logWriter_,
+                "java.sql.Types " + jdbcTypes_[column -1], "byte");
         }
     }
 
@@ -679,7 +703,8 @@
         case java.sql.Types.LONGVARCHAR:
             return agent_.crossConverters_.getShortFromString(getVARCHAR(column));
         default:
-            throw new ColumnTypeConversionException(agent_.logWriter_);
+            throw new ColumnTypeConversionException(agent_.logWriter_,
+                "java.sql.Types " + jdbcTypes_[column -1], "short");
         }
     }
 
@@ -706,7 +731,8 @@
         case java.sql.Types.LONGVARCHAR:
             return agent_.crossConverters_.getIntFromString(getVARCHAR(column));
         default:
-            throw new ColumnTypeConversionException(agent_.logWriter_);
+            throw new ColumnTypeConversionException(agent_.logWriter_,
+                "java.sql.Types " + jdbcTypes_[column -1], "int");
         }
     }
 
@@ -733,7 +759,8 @@
         case java.sql.Types.LONGVARCHAR:
             return agent_.crossConverters_.getLongFromString(getVARCHAR(column));
         default:
-            throw new ColumnTypeConversionException(agent_.logWriter_);
+            throw new ColumnTypeConversionException(agent_.logWriter_,
+                "java.sql.Types " + jdbcTypes_[column -1], "long");
         }
     }
 
@@ -760,7 +787,8 @@
         case java.sql.Types.LONGVARCHAR:
             return agent_.crossConverters_.getFloatFromString(getVARCHAR(column));
         default:
-            throw new ColumnTypeConversionException(agent_.logWriter_);
+            throw new ColumnTypeConversionException(agent_.logWriter_,
+                "java.sql.Types " + jdbcTypes_[column -1], "float");
         }
     }
 
@@ -789,7 +817,8 @@
         case java.sql.Types.LONGVARCHAR:
             return agent_.crossConverters_.getDoubleFromString(getVARCHAR(column));
         default:
-            throw new ColumnTypeConversionException(agent_.logWriter_);
+            throw new ColumnTypeConversionException(agent_.logWriter_,
+                "java.sql.Types " + jdbcTypes_[column -1], "double");
         }
     }
 
@@ -819,7 +848,8 @@
         case java.sql.Types.LONGVARCHAR:
             return agent_.crossConverters_.getBigDecimalFromString(getVARCHAR(column));
         default:
-            throw new ColumnTypeConversionException(agent_.logWriter_);
+            throw new ColumnTypeConversionException(agent_.logWriter_,
+                "java.sql.Types " + jdbcTypes_[column -1], "java.math.BigDecimal");
         }
     }
 
@@ -835,7 +865,8 @@
         case java.sql.Types.LONGVARCHAR:
             return agent_.crossConverters_.getDateFromString(getVARCHAR(column));
         default:
-            throw new ColumnTypeConversionException(agent_.logWriter_);
+            throw new ColumnTypeConversionException(agent_.logWriter_,
+                "java.sql.Types " + jdbcTypes_[column -1], "java.sql.Date");
         }
     }
 
@@ -851,7 +882,8 @@
         case java.sql.Types.LONGVARCHAR:
             return agent_.crossConverters_.getTimeFromString(getVARCHAR(column));
         default:
-            throw new ColumnTypeConversionException(agent_.logWriter_);
+            throw new ColumnTypeConversionException(agent_.logWriter_,
+                "java.sql.Types " + jdbcTypes_[column -1], "java.sql.Time");
         }
     }
 
@@ -869,7 +901,8 @@
         case java.sql.Types.LONGVARCHAR:
             return agent_.crossConverters_.getTimestampFromString(getVARCHAR(column));
         default:
-            throw new ColumnTypeConversionException(agent_.logWriter_);
+            throw new ColumnTypeConversionException(agent_.logWriter_,
+                "java.sql.Types " + jdbcTypes_[column -1], "java.sql.Timestamp");
         }
     }
 
@@ -923,7 +956,8 @@
                 Clob c = getClobColumn_(column, agent_);
                 return c.getSubString(1, (int) c.length());
             default:
-                throw new ColumnTypeConversionException(agent_.logWriter_);
+                throw new ColumnTypeConversionException(agent_.logWriter_,
+                    "java.sql.Types " + jdbcTypes_[column -1], "String");
             }
         } catch ( SQLException se ) {
             throw new SqlException(se);
@@ -942,7 +976,8 @@
                 Blob b = (Blob) getBlobColumn_(column, agent_);
                 return b.getBytes(1, (int) b.length());
             default:
-                throw new ColumnTypeConversionException(agent_.logWriter_);
+                throw new ColumnTypeConversionException(agent_.logWriter_,
+                    "java.sql.Types " + jdbcTypes_[column -1], "byte[]");
             }
         } catch ( SQLException se ) {
             throw new SqlException(se);
@@ -961,7 +996,8 @@
                 Blob b = (Blob) getBlobColumn_(column, agent_);
                 return b.getBinaryStream();
             default:
-                throw new ColumnTypeConversionException(agent_.logWriter_);
+                throw new ColumnTypeConversionException(agent_.logWriter_,
+                    "java.sql.Types " + jdbcTypes_[column -1], "java.io.InputStream");
             }
         } catch ( SQLException se ) {
             throw new SqlException(se);
@@ -978,14 +1014,18 @@
                 try {
                     return new java.io.ByteArrayInputStream(getCHAR(column).getBytes("US-ASCII"));
                 } catch (java.io.UnsupportedEncodingException e) {
-                    throw new SqlException(agent_.logWriter_, e.getMessage());
+                    throw new SqlException(agent_.logWriter_, 
+                    		new MessageId (SQLState.UNSUPPORTED_ENCODING), 
+                    		"CHAR", "java.io.InputStream", e);
                 }
             case java.sql.Types.VARCHAR:
             case java.sql.Types.LONGVARCHAR:
                 try {
                     return new java.io.ByteArrayInputStream(getVARCHAR(column).getBytes("US-ASCII"));
                 } catch (java.io.UnsupportedEncodingException e) {
-                    throw new SqlException(agent_.logWriter_, e.getMessage());
+                    throw new SqlException(agent_.logWriter_, 
+                    		new MessageId (SQLState.UNSUPPORTED_ENCODING), 
+                    		"VARCHAR/LONGVARCHAR", "java.io.InputStream", e);
                 }
             case java.sql.Types.BINARY:
                 return new java.io.ByteArrayInputStream(get_CHAR_FOR_BIT_DATA(column));
@@ -996,7 +1036,8 @@
                 Blob b = (Blob) getBlobColumn_(column, agent_);
                 return b.getBinaryStream();
             default:
-                throw new ColumnTypeConversionException(agent_.logWriter_);
+                throw new ColumnTypeConversionException(agent_.logWriter_,
+                    "java.sql.Types " + jdbcTypes_[column -1], "java.io.InputStream");
             }
         }
         catch ( SQLException se ) {
@@ -1014,7 +1055,9 @@
                     try {
                         return new java.io.ByteArrayInputStream(s.getBytes("UTF-8"));
                     } catch (java.io.UnsupportedEncodingException e) {
-                        throw new SqlException(agent_.logWriter_, e.getMessage());
+                        throw new SqlException(agent_.logWriter_, 
+                        		new MessageId (SQLState.UNSUPPORTED_ENCODING), 
+                        		"CLOB", "UnicodeStream", e);
                     }
                 }
             case java.sql.Types.CHAR:
@@ -1022,7 +1065,9 @@
                     try {
                         return new java.io.ByteArrayInputStream(getCHAR(column).getBytes("UTF-8"));
                     } catch (java.io.UnsupportedEncodingException e) {
-                        throw new SqlException(agent_.logWriter_, e.getMessage());
+                        throw new SqlException(agent_.logWriter_, 
+                        		new MessageId (SQLState.UNSUPPORTED_ENCODING), 
+                        		"CHAR", "UnicodeStream", e);
                     }
                 }
             case java.sql.Types.VARCHAR:
@@ -1030,7 +1075,9 @@
                 try {
                     return new java.io.ByteArrayInputStream(getVARCHAR(column).getBytes("UTF-8"));
                 } catch (java.io.UnsupportedEncodingException e) {
-                    throw new SqlException(agent_.logWriter_, e.getMessage());
+                    throw new SqlException(agent_.logWriter_, 
+                    		new MessageId (SQLState.UNSUPPORTED_ENCODING), 
+                    		"VARCHAR/LONGVARCHAR", "UnicodeStream", e);
                 }
             case java.sql.Types.BINARY:
                 return new java.io.ByteArrayInputStream(get_CHAR_FOR_BIT_DATA(column));
@@ -1041,7 +1088,8 @@
                 Blob b = (Blob) getBlobColumn_(column, agent_);
                 return b.getBinaryStream();
             default:
-                throw new ColumnTypeConversionException(agent_.logWriter_);
+                throw new ColumnTypeConversionException(agent_.logWriter_,
+                    "java.sql.Types " + jdbcTypes_[column -1], "UnicodeStream");
             }
         } catch ( SQLException se ) {
             throw new SqlException(se);
@@ -1063,24 +1111,31 @@
                 try {
                     return new java.io.InputStreamReader(new java.io.ByteArrayInputStream(get_CHAR_FOR_BIT_DATA(column)), "UTF-16BE");
                 } catch (java.io.UnsupportedEncodingException e) {
-                    throw new SqlException(agent_.logWriter_, "UnsupportedEncodingException: " + e.getMessage());
+                    throw new SqlException(agent_.logWriter_, 
+                    		new MessageId (SQLState.UNSUPPORTED_ENCODING), 
+                    		"BINARY", "java.io.Reader", e);
                 }
             case java.sql.Types.VARBINARY:
             case java.sql.Types.LONGVARBINARY:
                 try {
                     return new java.io.InputStreamReader(new java.io.ByteArrayInputStream(get_VARCHAR_FOR_BIT_DATA(column)), "UTF-16BE");
                 } catch (java.io.UnsupportedEncodingException e) {
-                    throw new SqlException(agent_.logWriter_, "UnsupportedEncodingException: " + e.getMessage());
+                    throw new SqlException(agent_.logWriter_, 
+                    		new MessageId (SQLState.UNSUPPORTED_ENCODING), 
+                    		"VARBINARY/LONGVARBINARY", "java.io.Reader", e);
                 }
             case java.sql.Types.BLOB:
                 try {
                     Blob b = (Blob) getBlobColumn_(column, agent_);
                     return new java.io.InputStreamReader(b.getBinaryStream(), "UTF-16BE");
                 } catch (java.io.UnsupportedEncodingException e) {
-                    throw new SqlException(agent_.logWriter_, "UnsupportedEncodingException: " + e.getMessage());
+                    throw new SqlException(agent_.logWriter_, 
+                    		new MessageId (SQLState.UNSUPPORTED_ENCODING), 
+                    		"BLOB", "java.io.Reader", e);
                 }
             default:
-                throw new ColumnTypeConversionException(agent_.logWriter_);
+                throw new ColumnTypeConversionException(agent_.logWriter_,
+                    "java.sql.Types " + jdbcTypes_[column -1], "java.io.Reader");
             }
         } catch ( SQLException se ) {
             throw new SqlException(se);
@@ -1092,7 +1147,8 @@
         case Types.BLOB:
             return getBlobColumn_(column, agent_);
         default:
-            throw new ColumnTypeConversionException(agent_.logWriter_);
+            throw new ColumnTypeConversionException(agent_.logWriter_,
+                "java.sql.Types " + jdbcTypes_[column -1], "java.sql.Blob");
         }
     }
 
@@ -1101,16 +1157,20 @@
         case Types.CLOB:
             return getClobColumn_(column, agent_);
         default:
-            throw new ColumnTypeConversionException(agent_.logWriter_);
+            throw new ColumnTypeConversionException(agent_.logWriter_,
+                "java.sql.Types " + jdbcTypes_[column -1], "java.sql.Clob");
         }
     }
 
     public final java.sql.Array getArray(int column) throws SqlException {
-        throw new SqlException(agent_.logWriter_, "not yet implemented");
+        throw new SqlException(agent_.logWriter_, 
+            new MessageId (SQLState.NOT_IMPLEMENTED),
+            "getArray(int)");
     }
 
     public final java.sql.Ref getRef(int column) throws SqlException {
-        throw new SqlException(agent_.logWriter_, "not yet implemented");
+        throw new SqlException(agent_.logWriter_, 
+            new MessageId (SQLState.NOT_IMPLEMENTED), "getRef(int)");
     }
 
     public final Object getObject(int column) throws SqlException {
@@ -1150,7 +1210,8 @@
         case java.sql.Types.CLOB:
             return getClobColumn_(column, agent_);
         default:
-            throw new ColumnTypeConversionException(agent_.logWriter_);
+            throw new ColumnTypeConversionException(agent_.logWriter_,
+                "java.sql.Types " + jdbcTypes_[column -1], "Object");
         }
     }
 

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=390536&r1=390535&r2=390536&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 Fri Mar 31 15:06:34 2006
@@ -27,6 +27,7 @@
 import org.apache.derby.iapi.services.info.JVMInfo;
 import org.apache.derby.shared.common.i18n.MessageUtil;
 import org.apache.derby.shared.common.error.ExceptionUtil;
+import org.apache.derby.shared.common.reference.SQLState;
 
 
 // The signature of the stored procedure SQLCAMessage I have come out so far is as follows:
@@ -149,6 +150,12 @@
         this(logwriter, msgid, new Object[] { arg1 }, cause);
     }
     
+    public SqlException(LogWriter logwriter, MessageId msgid,
+        Object arg1, Object arg2, Throwable cause)
+    {
+        this(logwriter, msgid, new Object[] { arg1, arg2 }, cause);
+    }
+    
     public SqlException(LogWriter logwriter,
         MessageId msgid, Object arg1, Object arg2)
     {
@@ -427,6 +434,16 @@
         ExceptionFormatter.printTrace(this, printWriter, header);
     }
     
+    /**
+     * Helper method to construct an exception which basically says that
+     * we encountered an underlying Java exception
+     */
+    public static SqlException javaException(LogWriter logWriter, Throwable e) {
+        return new SqlException(logWriter, 
+            new MessageId (SQLState.JAVA_EXCEPTION), 
+            new Object[] {e.getClass().getName(), e.getMessage()}, e);
+    }
+    
     // Return a single SQLException without the "next" pointing to another SQLException.
     // Because the "next" is a private field in java.sql.SQLException,
     // we have to create a new SqlException in order to break the chain with "next" as null.
@@ -476,10 +493,11 @@
 // for common ResultSet data conversion exceptions.
 
 class ColumnTypeConversionException extends SqlException {
-    ColumnTypeConversionException(LogWriter logWriter) {
+    ColumnTypeConversionException(LogWriter logWriter, String sourceType,
+        String targetType) {
         super(logWriter,
-                "Invalid data conversion:" +
-                " Wrong result column type for requested conversion.");
+            new MessageId(SQLState.LANG_DATA_TYPE_GET_MISMATCH),
+            sourceType, targetType);
     }
 }
 

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/Types.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/am/Types.java?rev=390536&r1=390535&r2=390536&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/Types.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/Types.java Fri Mar 31 15:06:34 2006
@@ -79,6 +79,32 @@
     // hide the default constructor
     private Types() {
    }
+    
+    static public String getTypeString(int type)
+    {
+        switch (type )
+        {
+            case BIGINT:        return "BIGINT";
+            case BINARY:        return "BINARY";
+            case BLOB:          return "BLOB";
+            case BOOLEAN:       return "BOOLEAN";
+            case CHAR:          return "CHAR";
+            case CLOB:          return "CLOB";
+            case DATE:          return "DATE";
+            case DECIMAL:       return "DECIMAL";
+            case DOUBLE:        return "DOUBLE";
+            case INTEGER:       return "INTEGER";
+            case LONGVARBINARY: return "LONGVARBINARY";
+            case LONGVARCHAR:   return "LONGVARCHAR";
+            case REAL:          return "REAL";
+            case SMALLINT:      return "SMALLINT";
+            case TIME:          return "TIME";
+            case TIMESTAMP:     return "TIMESTAMP";
+            case VARBINARY:     return "VARBINARY";
+            case VARCHAR:       return "VARCHAR";
+            default:            return "<UNKNOWN>";
+        }
+    }
 
     static public int mapDERBYTypeToDriverType(boolean isDescribed, int sqlType, long length, int ccsid) {
         switch (Utils.getNonNullableSqlType(sqlType)) { // mask the isNullable bit

Modified: db/derby/code/trunk/java/client/org/apache/derby/loc/clientmessages_en.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/loc/clientmessages_en.properties?rev=390536&r1=390535&r2=390536&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/loc/clientmessages_en.properties (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/loc/clientmessages_en.properties Fri Mar 31 15:06:34 2006
@@ -62,18 +62,7 @@
 XN006.S=Invalid parameter: calendar is null.
 XN009.S=Invalid argument: parameter index {0} is not an OUT or INOUT parameter.
 XN010.S=Parameter 1 is the return clause of the stored procedure call. It can only be registered as an integer type.
-XN100.S=Table name can not be null
-XN104.S=Shared key length is invalid: {0}.
-XN105.S=DES key has the wrong length, expected length {0}, got length {1}.
-XN106.S=No such padding 
-XN107.S=Bad Padding
-XN108.S=Illegal Block Size
-XN110.S=Primary table name can not be null
-XN111.S=Foreign table name can not be null
-XN112.S=Security exception encountered, see next exception for details.
 
-XN050.S=Required character converter not available for data type.
-XN051.S=Unsupported Encoding
 XN052.S=Search string cannot be null.
 XN053.S=Clob position must start from 1 or more.
 XN054.S=Invalid position {0} , offset {1} or length {2}
@@ -86,13 +75,22 @@
 XN061.S=The jdbcType {0} does not match between the setter method and the registerOutParameter method.
 XN062.S=Unrecognized jdbc type {0}
 XN063.S=Unrecognized driver type {0}
-XN064.S=Privileged Action Failed
-XN065.S=Missing resource bundle in {0} package for {1}
+XN064.S=An attempt to execute a privileged action failed.
+XN065.S=A resource bundle could not be found in the {0} package for {1}
 XN067.S=Cannot rollback or release a savepoint that was not created by this connection.
 XN068.S=Driver not capable
 XN069.S=The auto-generated keys value {0} is invalid
 XN070.S=The Reader/Stream object does not contain length characters
 
+XN100.S=Table name can not be null
+XN104.S=Shared key length is invalid: {0}.
+XN105.S=DES key has the wrong length, expected length {0}, got length {1}.
+XN106.S=No such padding 
+XN107.S=Bad Padding
+XN108.S=Illegal Block Size
+XN110.S=Primary table name can not be null
+XN111.S=Foreign table name can not be null
+XN112.S=Security exception encountered, see next exception for details.
 
 XN151.S=Unable to open file {0} : {1}
 

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=390536&r1=390535&r2=390536&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 Fri Mar 31 15:06:34 2006
@@ -371,6 +371,8 @@
 54006=The length resulting from {0} operation is greater than {1}.
 22003=The resulting value is outside the range for the data type {0}.
 22005=An attempt was made to get a data value of type ''{0}'' from a data value of type ''{1}''.
+22005.S.1=Unable to convert a value of type ''{0}'' to type ''{1}'' : the encoding is not supported.
+22005.S.2=The required character converter is not available.
 22007.S.180=The string representation of a datetime value is out of range.
 22007.S.181=The syntax of the string representation of a datetime value is incorrect.
 22008.S=''{0}'' is an invalid argument to the {1} function.

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=390536&r1=390535&r2=390536&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 Fri Mar 31 15:06:34 2006
@@ -680,6 +680,8 @@
 
 	String LANG_DB2_GETXXX_BAD_COLUMN_TYPE                             = "22005"; // same 22005 error
 	String LANG_DATA_TYPE_GET_MISMATCH                                 = "22005"; // same 22005 error
+    String UNSUPPORTED_ENCODING                                        = "22005.S.1";
+    String CHARACTER_CONVERTER_NOT_AVAILABLE                           = "22005.S.2";
 
 	String LANG_DATE_RANGE_EXCEPTION                                   = "22007.S.180";
 	String LANG_DATE_SYNTAX_EXCEPTION                                  = "22007.S.181";
@@ -1548,8 +1550,6 @@
     String PRIMARY_TABLE_NAME_IS_NULL                               = "XN110.S";
     String FOREIGN_TABLE_NAME_IS_NULL                               = "XN111.S";
     String SECURITY_EXCEPTION_ENCOUNTERED                           = "XN112.S";
-    String CHAR_CONVERTER_NOT_FOUND                                 = "XN050.S";
-    String UNSUPPORTED_ENCODING                                     = "XN051.S";
     String NULL_SEARCH_STRING                                       = "XN052.S";
     String INVALID_CLOB_START_POS                                   = "XN053.S";
     String INVALID_POS_OFFSET_OR_LEN                                = "XN054.S";
@@ -1562,7 +1562,7 @@
     String TYPE_MISMATH_WITH_REG_TYPE                               = "XN061.S";
     String BAD_JDBC_TYPE                                            = "XN062.S";
     String BAD_DRIVER_TYPE                                          = "XN063.S";
-    String ERROR_PRIVILEGED_ACTIOM                                  = "XN064.S";
+    String ERROR_PRIVILEGED_ACTION                                  = "XN064.S";
     String MISSING_RESOURCE_BUNDLE                                  = "XN065.S";
     String SAVEPOINT_NOT_CREATED_BY_CONNECTION                      = "XN067.S";
     String DRIVER_NOT_CAPABLE                                       = "XN068.S";



Mime
View raw message