db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davi...@apache.org
Subject svn commit: r399352 - in /db/derby/code/trunk/java: build/org/apache/derbyBuild/ client/org/apache/derby/jdbc/ engine/org/apache/derby/loc/ shared/org/apache/derby/shared/common/reference/
Date Wed, 03 May 2006 17:01:02 GMT
Author: davidvc
Date: Wed May  3 10:00:59 2006
New Revision: 399352

URL: http://svn.apache.org/viewcvs?rev=399352&view=rev
Log:
DERBY-850 - Internationalize client/org/apache/derby/jdbc classes.
Passes derbynetclientmats.


Modified:
    db/derby/code/trunk/java/build/org/apache/derbyBuild/splitmessages.java
    db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientBaseDataSource.java
    db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDriver.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/SQLState.java

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=399352&r1=399351&r2=399352&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 Wed May  3 10:00:59
2006
@@ -103,6 +103,7 @@
         clientMessageIds.add(SQLState.CANT_CONVERT_UNICODE_TO_EBCDIC);
         clientMessageIds.add(SQLState.SECMECH_NOT_SUPPORTED);
         clientMessageIds.add(SQLState.DRDA_COMMAND_NOT_IMPLEMENTED);
+        clientMessageIds.add(SQLState.JDBC_DRIVER_REGISTER);
     }
 
 	public static void main(String[] args) throws Exception {

Modified: db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientBaseDataSource.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientBaseDataSource.java?rev=399352&r1=399351&r2=399352&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientBaseDataSource.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientBaseDataSource.java Wed May
 3 10:00:59 2006
@@ -41,10 +41,12 @@
 import org.apache.derby.client.am.LogWriter;
 import org.apache.derby.client.am.SqlException;
 import org.apache.derby.client.am.Connection;
+import org.apache.derby.client.am.ClientMessageId;
 import org.apache.derby.client.net.NetConfiguration;
 import org.apache.derby.client.net.NetLogWriter;
 import org.apache.derby.client.ClientDataSourceFactory;
 import org.apache.derby.shared.common.reference.Attribute;
+import org.apache.derby.shared.common.reference.SQLState;
 
 /**
  * Base class for client-side DataSource implementations.
@@ -593,14 +595,18 @@
 
                 int eqPos = v.indexOf('=');
                 if (eqPos == -1) {
-                    throw new SqlException(null, "Invalid attribute syntax: " + attributeString);
+                    throw new SqlException(null, 
+                        new ClientMessageId(SQLState.INVALID_ATTRIBUTE_SYNTAX),
+                        attributeString);
                 }
 
                 augmentedProperties.setProperty((v.substring(0, eqPos)).trim(), (v.substring(eqPos
+ 1)).trim());
             }
         } catch (NoSuchElementException e) {
             // A null log writer is passed, because jdbc 1 sqlexceptions are automatically
traced
-            throw new SqlException(null, e, "Invalid attribute syntax: " + attributeString);
+            throw new SqlException(null, 
+                new ClientMessageId(SQLState.INVALID_ATTRIBUTE_SYNTAX),
+                attributeString, e);
         }
         checkBoolean(augmentedProperties, Attribute.CLIENT_RETIEVE_MESSAGE_TEXT);
         return augmentedProperties;
@@ -635,9 +641,9 @@
             choicesStr += choices[i];
         }
 
-        throw new SqlException(null, "JDBC attribute " + attribute +
-                "has an invalid value " + value +
-                " Valid values are " + choicesStr);
+        throw new SqlException(null, 
+            new ClientMessageId(SQLState.INVALID_ATTRIBUTE),
+            attribute, value, choicesStr);
     }
 
     /*

Modified: db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDriver.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDriver.java?rev=399352&r1=399351&r2=399352&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDriver.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDriver.java Wed May  3 10:00:59
2006
@@ -29,9 +29,11 @@
 import org.apache.derby.client.am.Utils;
 import org.apache.derby.client.am.Version;
 import org.apache.derby.client.am.ClientJDBCObjectFactory;
+import org.apache.derby.client.am.ClientMessageId;
 import org.apache.derby.client.net.ClientJDBCObjectFactoryImpl;
 import org.apache.derby.client.resources.ResourceKeys;
 import org.apache.derby.shared.common.reference.Attribute;
+import org.apache.derby.shared.common.reference.SQLState;
 
 
 public class ClientDriver implements java.sql.Driver {
@@ -60,7 +62,8 @@
         } catch (java.sql.SQLException e) {
             // A null log writer is passed, because jdbc 1 sql exceptions are automatically
traced
             exceptionsOnLoadDriver__ =
-                    new SqlException(null, "Error occurred while trying to register Dnc driver
with JDBC 1 Driver Manager").getSQLException();
+                    new SqlException(null, 
+                        new ClientMessageId(SQLState.JDBC_DRIVER_REGISTER)).getSQLException();
             exceptionsOnLoadDriver__.setNextException(e);
         }
     }
@@ -94,7 +97,9 @@
                     slashOrNull = urlTokenizer.nextToken(":/");
                 } catch (java.util.NoSuchElementException e) {
                     // A null log writer is passed, because jdbc 1 sqlexceptions are automatically
traced
-                    throw new SqlException(null, e, "Invalid database url syntax: " + url);
+                    throw new SqlException(null, 
+                        new ClientMessageId(SQLState.MALFORMED_URL),
+                        url, e);
                 }
             }
             String server = tokenizeServerName(urlTokenizer, url);    // "/server"
@@ -114,7 +119,8 @@
                 traceLevel = ClientDataSource.getTraceLevel(augmentedProperties);
             } catch (java.lang.NumberFormatException e) {
                 // A null log writer is passed, because jdbc 1 sqlexceptions are automatically
traced
-                throw new SqlException(null, e, "trouble reading traceLevel connection property");
+                throw new SqlException(null, 
+                    new ClientMessageId(SQLState.TRACELEVEL_FORMAT_INVALID), e);
             }
 
             // Jdbc 1 connections will write driver trace info on a
@@ -280,12 +286,14 @@
             if (!urlTokenizer.nextToken("/").equals("/"))
             // A null log writer is passed, because jdbc 1 sqlexceptions are automatically
traced
             {
-                throw new SqlException(null, "Invalid database url syntax: " + url);
+                throw new SqlException(null, 
+                    new ClientMessageId(SQLState.MALFORMED_URL), url);
             }
             return urlTokenizer.nextToken("/:");
         } catch (java.util.NoSuchElementException e) {
             // A null log writer is passed, because jdbc 1 sqlexceptions are automatically
traced
-            throw new SqlException(null, e, "Invalid database url syntax: " + url);
+                throw new SqlException(null, 
+                    new ClientMessageId(SQLState.MALFORMED_URL), url);
         }
     }
 
@@ -299,18 +307,21 @@
                 String port = urlTokenizer.nextToken("/");
                 if (!urlTokenizer.nextToken("/").equals("/")) {
                     // A null log writer is passed, because jdbc 1 sqlexceptions are automatically
traced
-                    throw new SqlException(null, "Invalid database url syntax: " + url);
+                    throw new SqlException(null, 
+                        new ClientMessageId(SQLState.MALFORMED_URL), url);
                 }
                 return Integer.parseInt(port);
             } else if (firstToken.equals("/")) {
                 return 0;
             } else {
                 // A null log writer is passed, because jdbc 1 sqlexceptions are automatically
traced
-                throw new SqlException(null, "Invalid database url syntax: " + url);
+                throw new SqlException(null, 
+                    new ClientMessageId(SQLState.MALFORMED_URL), url);
             }
         } catch (java.util.NoSuchElementException e) {
             // A null log writer is passed, because jdbc 1 sqlexceptions are automatically
traced
-            throw new SqlException(null, e, "Invalid database url syntax: " + url);
+            throw new SqlException(null, 
+                new ClientMessageId(SQLState.MALFORMED_URL), url, e);
         }
     }
 
@@ -323,7 +334,8 @@
             return databaseName;
         } catch (java.util.NoSuchElementException e) {
             // A null log writer is passed, because jdbc 1 sqlexceptions are automatically
traced
-            throw new SqlException(null, e, "Invalid database url syntax: " + url);
+            throw new SqlException(null, 
+                new ClientMessageId(SQLState.MALFORMED_URL), url, e);
         }
     }
 

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=399352&r1=399351&r2=399352&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 Wed May  3
10:00:59 2006
@@ -1214,6 +1214,8 @@
 XJ209.S=The required stored procedure is not installed on the server.
 XJ210.S=The load module name for the stored procedure on the server is not found.
 XJ211.S=Non-recoverable chain-breaking exception occurred during batch processing. The batch
is terminated non-atomically.
+XJ212.S=Invalid attribute syntax: {0}
+XJ213.C=The traceLevel connection property does not have a valid format for a number.
 
 #XN - Network level messages
 XN001.S=Connection reset is not allowed when inside a unit of work.

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=399352&r1=399351&r2=399352&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
Wed May  3 10:00:59 2006
@@ -1510,6 +1510,8 @@
     String STORED_PROC_NOT_INSTALLED = "XJ209.S";
     String STORED_PROC_LOAD_MODULE_NOT_FOUND = "XJ210.S";
     String BATCH_CHAIN_BREAKING_EXCEPTION = "XJ211.S";
+    String INVALID_ATTRIBUTE_SYNTAX = "XJ212.S";
+    String TRACELEVEL_FORMAT_INVALID = "XJ213.S";
     
     //XN - Network-level messages
     String NET_CONNECTION_RESET_NOT_ALLOWED_IN_UNIT_OF_WORK         = "XN001.S";



Mime
View raw message