]> granicus.if.org Git - postgresql/commitdiff
>
authorBruce Momjian <bruce@momjian.us>
Tue, 21 Aug 2001 00:37:23 +0000 (00:37 +0000)
committerBruce Momjian <bruce@momjian.us>
Tue, 21 Aug 2001 00:37:23 +0000 (00:37 +0000)
> Shouldn't
>
>    throw new PSQLException("metadata unavailable");
>
> in getTypeInfo() be something like:
>
>    throw new PSQLException("postgresql.meta.unavailable");
>
> to allow translation of the error message in the
> errors*.properties files?

You're right. Attached is an updated patch that also includes a message
in error.properties. I've attempted a French message in
errors_fr.properties but beware that I haven't written French in quite a
few years. Don't know Italian, German, or Dutch so I can't do those.

Liam Stewart

src/interfaces/jdbc/org/postgresql/errors.properties
src/interfaces/jdbc/org/postgresql/errors_fr.properties
src/interfaces/jdbc/org/postgresql/jdbc1/DatabaseMetaData.java
src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java

index e5d35871554bc9efb4d3ca4adc67a28b3ab95552..f5af3680185dfbc4e8e58db02b5a1ce73ad14eb3 100644 (file)
@@ -35,6 +35,7 @@ postgresql.geo.path:Cannot tell if path is open or closed.
 postgresql.geo.point:Conversion of point failed - {0}
 postgresql.jvm.version:The postgresql.jar file does not contain the correct JDBC classes for this JVM. Try rebuilding. If that fails, try forcing the version supplying it to the command line using the argument -Djava.version=1.1 or -Djava.version=1.2\nException thrown was {0}
 postgresql.lo.init:failed to initialise LargeObject API
+postgresql.metadata.unavailable:Metadata unavailable.
 postgresql.money:conversion of money failed - {0}.
 postgresql.noupdate:This ResultSet is not updateable.
 postgresql.notsensitive:This ResultSet is not sensitive to realtime updates after the query has run.
index c65b28187e8e6453da5bafd3e99b44f5657ce0ac..79d40e29743fc9543f0c90bd9609a7bf18dd1ede 100644 (file)
@@ -1,5 +1,6 @@
 # This is the french version of some errors. Errors not in this file
 # are handled by the parent errors.properties file.
 postgresql.jvm.version:Le fichier de postgresql.jar ne contient pas les classes correctes de JDBC pour ce JVM. Try que rebuilding.\nException jet\81ées \81était {0}
+postgresql.metadata.unavailable: Les métadonnées ne sont pas disponibles.
 postgresql.unusual:Quelque chose de peu commun s'est produit pour faire \81échouer le gestionnaire. Veuillez enregistrer cette exception: {0}
 postgresql.unimplemented:Cette m\81éthode n'est pas encore appliqu\81ée.
index 3eb3c7c33ead290701e8e9222d6645ddb8697a30..6ac4ffa04e8ed9c02b95f18ed93e7255434884d5 100644 (file)
@@ -8,6 +8,7 @@ package org.postgresql.jdbc1;
 import java.sql.*;
 import java.util.*;
 import org.postgresql.Field;
+import org.postgresql.util.PSQLException;
 
 /**
  * This class provides information about the database as a whole.
@@ -2068,6 +2069,8 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
    * Get a description of the access rights for each table available
    * in a catalog.
    *
+   * This method is currently unimplemented.
+   *
    * <P>Only privileges matching the schema and table name
    * criteria are returned.  They are ordered by TABLE_SCHEM,
    * TABLE_NAME, and PRIVILEGE.
@@ -2095,8 +2098,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
    */
   public java.sql.ResultSet getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern) throws SQLException
   {
-    // XXX-Not Implemented
-    return null;
+      throw org.postgresql.Driver.notImplemented();
   }
 
   /**
@@ -2158,6 +2160,8 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
    * updated when any value in a row is updated.  They are
    * unordered.
    *
+   * This method is currently unimplemented.
+   *
    * <P>Each column description has the following columns:
    *  <OL>
    *   <LI><B>SCOPE</B> short => is not used
@@ -2183,8 +2187,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
    */
  public java.sql.ResultSet getVersionColumns(String catalog, String schema, String table) throws SQLException
   {
-    // XXX-Not Implemented
-    return null;
+      throw org.postgresql.Driver.notImplemented();
   }
 
   /**
@@ -2396,6 +2399,8 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
    * table).  They are ordered by FKTABLE_CAT, FKTABLE_SCHEM,
    * FKTABLE_NAME, and KEY_SEQ.
    *
+   * This method is currently unimplemented.
+   *
    * <P>Each foreign key column description has the following columns:
    *  <OL>
    *   <LI><B>PKTABLE_CAT</B> String => primary key table catalog (may be null)
@@ -2443,8 +2448,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
    */
   public java.sql.ResultSet getExportedKeys(String catalog, String schema, String table) throws SQLException
   {
-    // XXX-Not Implemented
-    return null;
+      throw org.postgresql.Driver.notImplemented();
   }
 
   /**
@@ -2456,6 +2460,8 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
    * are ordered by FKTABLE_CAT, FKTABLE_SCHEM, FKTABLE_NAME, and
    * KEY_SEQ.
    *
+   * This method is currently unimplemented.
+   *
    * <P>Each foreign key column description has the following columns:
    *  <OL>
    *   <LI><B>PKTABLE_CAT</B> String => primary key table catalog (may be null)
@@ -2503,8 +2509,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
    */
   public java.sql.ResultSet getCrossReference(String primaryCatalog, String primarySchema, String primaryTable, String foreignCatalog, String foreignSchema, String foreignTable) throws SQLException
   {
-    // XXX-Not Implemented
-    return null;
+      throw org.postgresql.Driver.notImplemented();
   }
 
   /**
@@ -2609,7 +2614,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
       return new ResultSet(connection, f, v, "OK", 1);
     }
 
-    return null;
+    throw new PSQLException("postgresql.metadata.unavailable");
   }
 
   /**
index 3ab00c7cc9f5a331df0f7085c825b9c4a5fa08f7..1b80d39f3f838034a294bf0fe056e2121d71d132 100644 (file)
@@ -8,6 +8,7 @@ package org.postgresql.jdbc2;
 import java.sql.*;
 import java.util.*;
 import org.postgresql.Field;
+import org.postgresql.util.PSQLException;
 
 /**
  * This class provides information about the database as a whole.
@@ -2069,6 +2070,8 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
    * Get a description of the access rights for each table available
    * in a catalog.
    *
+   * This method is currently unimplemented.
+   *
    * <P>Only privileges matching the schema and table name
    * criteria are returned.  They are ordered by TABLE_SCHEM,
    * TABLE_NAME, and PRIVILEGE.
@@ -2096,14 +2099,15 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
    */
   public java.sql.ResultSet getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern) throws SQLException
   {
-    // XXX-Not Implemented
-    return null;
+    throw org.postgresql.Driver.notImplemented();
   }
 
   /**
    * Get a description of a table's optimal set of columns that
    * uniquely identifies a row. They are ordered by SCOPE.
    *
+   * This method is currently not implemented.
+   *
    * <P>Each column description has the following columns:
    *  <OL>
    *   <LI><B>SCOPE</B> short => actual scope of result
@@ -2159,6 +2163,8 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
    * updated when any value in a row is updated.  They are
    * unordered.
    *
+   * This method is currently unimplemented.
+   *
    * <P>Each column description has the following columns:
    *  <OL>
    *   <LI><B>SCOPE</B> short => is not used
@@ -2184,8 +2190,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
    */
  public java.sql.ResultSet getVersionColumns(String catalog, String schema, String table) throws SQLException
   {
-    // XXX-Not Implemented
-    return null;
+    throw org.postgresql.Driver.notImplemented();
   }
 
   /**
@@ -2398,6 +2403,8 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
    * table).  They are ordered by FKTABLE_CAT, FKTABLE_SCHEM,
    * FKTABLE_NAME, and KEY_SEQ.
    *
+   * This method is currently unimplemented.
+   *
    * <P>Each foreign key column description has the following columns:
    *  <OL>
    *   <LI><B>PKTABLE_CAT</B> String => primary key table catalog (may be null)
@@ -2445,8 +2452,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
    */
   public java.sql.ResultSet getExportedKeys(String catalog, String schema, String table) throws SQLException
   {
-    // XXX-Not Implemented
-    return null;
+    throw org.postgresql.Driver.notImplemented();
   }
 
   /**
@@ -2458,6 +2464,8 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
    * are ordered by FKTABLE_CAT, FKTABLE_SCHEM, FKTABLE_NAME, and
    * KEY_SEQ.
    *
+   * This method is currently unimplemented.
+   *
    * <P>Each foreign key column description has the following columns:
    *  <OL>
    *   <LI><B>PKTABLE_CAT</B> String => primary key table catalog (may be null)
@@ -2505,8 +2513,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
    */
   public java.sql.ResultSet getCrossReference(String primaryCatalog, String primarySchema, String primaryTable, String foreignCatalog, String foreignSchema, String foreignTable) throws SQLException
   {
-    // XXX-Not Implemented
-    return null;
+    throw org.postgresql.Driver.notImplemented();
   }
 
   /**
@@ -2611,7 +2618,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
       return new ResultSet(connection, f, v, "OK", 1);
     }
 
-    return null;
+    throw new PSQLException("postgresql.metadata.unavailable");
   }
 
   /**