From: Bruce Momjian Date: Tue, 21 Aug 2001 00:37:23 +0000 (+0000) Subject: > X-Git-Tag: REL7_2_BETA1~668 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=44ae35cab91f1e5a6452da489d4a0c34e181afb9;p=postgresql > > 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 --- diff --git a/src/interfaces/jdbc/org/postgresql/errors.properties b/src/interfaces/jdbc/org/postgresql/errors.properties index e5d3587155..f5af368018 100644 --- a/src/interfaces/jdbc/org/postgresql/errors.properties +++ b/src/interfaces/jdbc/org/postgresql/errors.properties @@ -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. diff --git a/src/interfaces/jdbc/org/postgresql/errors_fr.properties b/src/interfaces/jdbc/org/postgresql/errors_fr.properties index c65b28187e..79d40e2974 100644 --- a/src/interfaces/jdbc/org/postgresql/errors_fr.properties +++ b/src/interfaces/jdbc/org/postgresql/errors_fr.properties @@ -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ées é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 échouer le gestionnaire. Veuillez enregistrer cette exception: {0} postgresql.unimplemented:Cette méthode n'est pas encore appliquée. diff --git a/src/interfaces/jdbc/org/postgresql/jdbc1/DatabaseMetaData.java b/src/interfaces/jdbc/org/postgresql/jdbc1/DatabaseMetaData.java index 3eb3c7c33e..6ac4ffa04e 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc1/DatabaseMetaData.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc1/DatabaseMetaData.java @@ -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. + * *

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. + * *

Each column description has the following columns: *

    *
  1. SCOPE 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. + * *

    Each foreign key column description has the following columns: *

      *
    1. PKTABLE_CAT 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. + * *

      Each foreign key column description has the following columns: *

        *
      1. PKTABLE_CAT 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"); } /** diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java b/src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java index 3ab00c7cc9..1b80d39f3f 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java @@ -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. + * *

        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. + * *

        Each column description has the following columns: *

          *
        1. SCOPE 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. + * *

          Each column description has the following columns: *

            *
          1. SCOPE 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. + * *

            Each foreign key column description has the following columns: *

              *
            1. PKTABLE_CAT 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. + * *

              Each foreign key column description has the following columns: *

                *
              1. PKTABLE_CAT 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"); } /**