diff --git a/src/interfaces/jdbc/org/postgresql/Driver.java.in b/src/interfaces/jdbc/org/postgresql/Driver.java.in index ecb22c7a0daf2e0341d7f1478b8638a2f02d22f3..009ac6100e8febec6b212207c2125121c6cdd12d 100644 --- a/src/interfaces/jdbc/org/postgresql/Driver.java.in +++ b/src/interfaces/jdbc/org/postgresql/Driver.java.in @@ -442,6 +442,6 @@ public class Driver implements java.sql.Driver } //The build number should be incremented for every new build - private static int m_buildNumber = 102; + private static int m_buildNumber = 103; } diff --git a/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java b/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java index f6d3807bb9acfbbf279a5ef83bb1637fd552c0aa..b66cda3a6ade0d41d59b49cf2944344809b77682 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java @@ -13,7 +13,7 @@ import org.postgresql.largeobject.LargeObjectManager; import org.postgresql.util.*; -/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Connection.java,v 1.2 2002/07/25 22:45:27 barry Exp $ +/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Connection.java,v 1.3 2002/07/26 05:29:34 barry Exp $ * This class defines methods of the jdbc1 specification. This class is * extended by org.postgresql.jdbc2.AbstractJdbc2Connection which adds the jdbc2 * methods. The real Connection class (for jdbc1) is org.postgresql.jdbc1.Jdbc1Connection @@ -78,6 +78,10 @@ public abstract class AbstractJdbc1Connection implements org.postgresql.PGConnec */ private int isolationLevel = java.sql.Connection.TRANSACTION_READ_COMMITTED; + + public abstract java.sql.Statement createStatement() throws SQLException; + + /* * This method actually opens the connection. It is called by Driver. * @@ -361,6 +365,8 @@ public abstract class AbstractJdbc1Connection implements org.postgresql.PGConnec public abstract java.sql.ResultSet getResultSet(Statement statement, org.postgresql.Field[] fields, Vector tuples, String status, int updateCount, long insertOID, boolean binaryCursor) throws SQLException; + public abstract java.sql.ResultSet getResultSet(Statement statement, org.postgresql.Field[] fields, Vector tuples, String status, int updateCount) throws SQLException; + /* * This adds a warning to the warning chain. * @param msg message to add diff --git a/src/interfaces/jdbc/org/postgresql/jdbc1/DatabaseMetaData.java b/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java similarity index 97% rename from src/interfaces/jdbc/org/postgresql/jdbc1/DatabaseMetaData.java rename to src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java index bf81f78874d2f5823951bb3bf6ffba33e811013e..3fd64c8c36301c0b7ecd17fd7fb42907e9681e1a 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc1/DatabaseMetaData.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java @@ -1,52 +1,23 @@ package org.postgresql.jdbc1; -// IMPORTANT NOTE: This file implements the JDBC 1 version of the driver. -// If you make any modifications to this file, you must make sure that the -// changes are also made (if relevent) to the related JDBC 2 class in the -// org.postgresql.jdbc2 package. 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. - * - * $Id: DatabaseMetaData.java,v 1.49 2002/07/25 22:45:28 barry Exp $ - * - *
Many of the methods here return lists of information in ResultSets. You - * can use the normal ResultSet methods such as getString and getInt to - * retrieve the data from these ResultSets. If a given form of metadata is - * not available, these methods should throw a SQLException. - * - *
Some of these methods take arguments that are String patterns. These - * arguments all have names such as fooPattern. Within a pattern String, - * "%" means match any substring of 0 or more characters, and "_" means - * match any one character. Only metadata entries matching the search - * pattern are returned. if a search pattern argument is set to a null - * ref, it means that argument's criteria should be dropped from the - * search. - * - *
A SQLException will be throws if a driver does not support a meta - * data method. In the case of methods that return a ResultSet, either - * a ResultSet (which may be empty) is returned or a SQLException is - * thrown. - * - * @see java.sql.DatabaseMetaData - */ -public class DatabaseMetaData implements java.sql.DatabaseMetaData +public abstract class AbstractJdbc1DatabaseMetaData { - Jdbc1Connection connection; // The connection association + protected AbstractJdbc1Connection connection; // The connection association // These define various OID's. Hopefully they will stay constant. - static final int iVarcharOid = 1043; // OID for varchar - static final int iBoolOid = 16; // OID for bool - static final int iInt2Oid = 21; // OID for int2 - static final int iInt4Oid = 23; // OID for int4 - static final int VARHDRSZ = 4; // length for int4 + protected static final int iVarcharOid = 1043; // OID for varchar + protected static final int iBoolOid = 16; // OID for bool + protected static final int iInt2Oid = 21; // OID for int2 + protected static final int iInt4Oid = 23; // OID for int4 + protected static final int VARHDRSZ = 4; // length for int4 - public DatabaseMetaData(Jdbc1Connection conn) + public AbstractJdbc1DatabaseMetaData(AbstractJdbc1Connection conn) { this.connection = conn; } @@ -2340,13 +2311,13 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData if (col > -1) { String rule = proname.substring(8, proname.length() - 4); - int action = importedKeyNoAction; + int action = java.sql.DatabaseMetaData.importedKeyNoAction; if ("cascade".equals(rule)) - action = importedKeyCascade; + action = java.sql.DatabaseMetaData.importedKeyCascade; else if ("setnull".equals(rule)) - action = importedKeySetNull; + action = java.sql.DatabaseMetaData.importedKeySetNull; else if ("setdefault".equals(rule)) - action = importedKeySetDefault; + action = java.sql.DatabaseMetaData.importedKeySetDefault; tuple[col] = Integer.toString(action).getBytes(); if (!foundRule) @@ -2388,15 +2359,15 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData tuple[12] = rs.getBytes(4); //PK_NAME // DEFERRABILITY - int deferrability = importedKeyNotDeferrable; + int deferrability = java.sql.DatabaseMetaData.importedKeyNotDeferrable; boolean deferrable = rs.getBoolean(5); boolean initiallyDeferred = rs.getBoolean(6); if (deferrable) { if (initiallyDeferred) - deferrability = importedKeyInitiallyDeferred; + deferrability = java.sql.DatabaseMetaData.importedKeyInitiallyDeferred; else - deferrability = importedKeyInitiallyImmediate; + deferrability = java.sql.DatabaseMetaData.importedKeyInitiallyImmediate; } tuple[13] = Integer.toString(deferrability).getBytes(); @@ -2669,8 +2640,8 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData byte b9[] = "9".getBytes(); byte b10[] = "10".getBytes(); byte bf[] = "f".getBytes(); - byte bnn[] = Integer.toString(typeNoNulls).getBytes(); - byte bts[] = Integer.toString(typeSearchable).getBytes(); + byte bnn[] = Integer.toString(java.sql.DatabaseMetaData.typeNoNulls).getBytes(); + byte bts[] = Integer.toString(java.sql.DatabaseMetaData.typeSearchable).getBytes(); while (rs.next()) { @@ -2811,10 +2782,10 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData tuple[4] = null; tuple[5] = r.getBytes(3); tuple[6] = r.getBoolean(4) ? - Integer.toString(tableIndexClustered).getBytes() : + Integer.toString(java.sql.DatabaseMetaData.tableIndexClustered).getBytes() : r.getString(5).equals("hash") ? - Integer.toString(tableIndexHashed).getBytes() : - Integer.toString(tableIndexOther).getBytes(); + Integer.toString(java.sql.DatabaseMetaData.tableIndexHashed).getBytes() : + Integer.toString(java.sql.DatabaseMetaData.tableIndexOther).getBytes(); tuple[7] = Integer.toString(i + 1).getBytes(); if (columnNameRS.next()) { diff --git a/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSetMetaData.java b/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSetMetaData.java similarity index 94% rename from src/interfaces/jdbc/org/postgresql/jdbc1/ResultSetMetaData.java rename to src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSetMetaData.java index ee737604a1ecf5bf45250633278556d903f4d662..2a598d3c3947fe62cd4d4c35b2158224ed07b2d9 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSetMetaData.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSetMetaData.java @@ -1,31 +1,17 @@ package org.postgresql.jdbc1; -// IMPORTANT NOTE: This file implements the JDBC 1 version of the driver. -// If you make any modifications to this file, you must make sure that the -// changes are also made (if relevent) to the related JDBC 2 class in the -// org.postgresql.jdbc2 package. import java.lang.*; import java.util.*; import org.postgresql.*; import org.postgresql.util.*; - -// We explicitly import classes here as the original line: -//import java.sql.*; -// causes javac to get confused. import java.sql.SQLException; import java.sql.Types; -/* - * A ResultSetMetaData object can be used to find out about the types and - * properties of the columns in a ResultSet - * - * @see java.sql.ResultSetMetaData - */ -public class ResultSetMetaData implements java.sql.ResultSetMetaData +public abstract class AbstractJdbc1ResultSetMetaData { - Vector rows; - Field[] fields; + protected Vector rows; + protected Field[] fields; /* * Initialise for a result with a tuple set and @@ -34,7 +20,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData * @param rows the Vector of rows returned by the ResultSet * @param fields the array of field descriptors */ - public ResultSetMetaData(Vector rows, Field[] fields) + public AbstractJdbc1ResultSetMetaData(Vector rows, Field[] fields) { this.rows = rows; this.fields = fields; @@ -149,7 +135,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData * defined with NOT NULL or PRIMARY KEY, CHECK constraints, views, * functions etc. */ - return columnNullableUnknown; + return java.sql.ResultSetMetaData.columnNullableUnknown; } /* diff --git a/src/interfaces/jdbc/org/postgresql/jdbc1/Jdbc1Connection.java b/src/interfaces/jdbc/org/postgresql/jdbc1/Jdbc1Connection.java index b67b07fde9387124c74ba9041d6801553d05e354..618ffa0df8ca56c57eae065f4253b8e2fd508129 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc1/Jdbc1Connection.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc1/Jdbc1Connection.java @@ -6,7 +6,7 @@ import java.sql.*; import org.postgresql.Field; import org.postgresql.util.PSQLException; -/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/Jdbc1Connection.java,v 1.3 2002/07/25 22:45:28 barry Exp $ +/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/Jdbc1Connection.java,v 1.4 2002/07/26 05:29:35 barry Exp $ * This class implements the java.sql.Connection interface for JDBC1. * However most of the implementation is really done in * org.postgresql.jdbc1.AbstractJdbc1Connection @@ -32,7 +32,7 @@ public class Jdbc1Connection extends org.postgresql.jdbc1.AbstractJdbc1Connectio public java.sql.DatabaseMetaData getMetaData() throws SQLException { if (metadata == null) - metadata = new org.postgresql.jdbc1.DatabaseMetaData(this); + metadata = new org.postgresql.jdbc1.Jdbc1DatabaseMetaData(this); return metadata; } diff --git a/src/interfaces/jdbc/org/postgresql/jdbc1/Jdbc1DatabaseMetaData.java b/src/interfaces/jdbc/org/postgresql/jdbc1/Jdbc1DatabaseMetaData.java new file mode 100644 index 0000000000000000000000000000000000000000..f2bde3e2485c12f16e438cb2d8283271ff8698f5 --- /dev/null +++ b/src/interfaces/jdbc/org/postgresql/jdbc1/Jdbc1DatabaseMetaData.java @@ -0,0 +1,16 @@ +package org.postgresql.jdbc1; + + +import java.sql.*; +import java.util.*; +import org.postgresql.Field; +import org.postgresql.util.PSQLException; + +public class Jdbc1DatabaseMetaData extends AbstractJdbc1DatabaseMetaData implements java.sql.DatabaseMetaData +{ + public Jdbc1DatabaseMetaData(Jdbc1Connection conn) + { + super(conn); + } + +} diff --git a/src/interfaces/jdbc/org/postgresql/jdbc1/Jdbc1ResultSet.java b/src/interfaces/jdbc/org/postgresql/jdbc1/Jdbc1ResultSet.java index 57850569ec893cc40fa3eb60cee03631ec31e123..845889ed8c87a853d3b8f3004d2af0d23042f4a1 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc1/Jdbc1ResultSet.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc1/Jdbc1ResultSet.java @@ -5,7 +5,7 @@ import java.sql.*; import java.util.Vector; import org.postgresql.Field; -/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/Jdbc1ResultSet.java,v 1.2 2002/07/25 22:45:28 barry Exp $ +/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/Jdbc1ResultSet.java,v 1.3 2002/07/26 05:29:35 barry Exp $ * This class implements the java.sql.ResultSet interface for JDBC1. * However most of the implementation is really done in * org.postgresql.jdbc1.AbstractJdbc1ResultSet @@ -20,7 +20,7 @@ public class Jdbc1ResultSet extends org.postgresql.jdbc1.AbstractJdbc1ResultSet public java.sql.ResultSetMetaData getMetaData() throws SQLException { - return new ResultSetMetaData(rows, fields); + return new Jdbc1ResultSetMetaData(rows, fields); } } diff --git a/src/interfaces/jdbc/org/postgresql/jdbc1/Jdbc1ResultSetMetaData.java b/src/interfaces/jdbc/org/postgresql/jdbc1/Jdbc1ResultSetMetaData.java new file mode 100644 index 0000000000000000000000000000000000000000..998e7fd5a868089a68c1e1a5c0fd8bbe4cf84e49 --- /dev/null +++ b/src/interfaces/jdbc/org/postgresql/jdbc1/Jdbc1ResultSetMetaData.java @@ -0,0 +1,11 @@ +package org.postgresql.jdbc1; + +public class Jdbc1ResultSetMetaData extends AbstractJdbc1ResultSetMetaData implements java.sql.ResultSetMetaData +{ + public Jdbc1ResultSetMetaData(java.util.Vector rows, org.postgresql.Field[] fields) + { + super(rows, fields); + } + +} + diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java b/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java similarity index 97% rename from src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java rename to src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java index a1c8e22737b24d2a05f8aa5ed4b196682ac8e3d2..432ee15f5284f850c81034d16cef417d7a752555 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java @@ -1,10 +1,5 @@ package org.postgresql.jdbc2; -// IMPORTANT NOTE: This file implements the JDBC 2 version of the driver. -// If you make any modifications to this file, you must make sure that the -// changes are also made (if relevent) to the related JDBC 1 class in the -// org.postgresql.jdbc1 package. - import java.sql.*; import java.util.*; @@ -12,45 +7,12 @@ import org.postgresql.Driver; import org.postgresql.Field; import org.postgresql.util.PSQLException; -/* - * This class provides information about the database as a whole. - * - * $Id: DatabaseMetaData.java,v 1.60 2002/07/25 22:45:28 barry Exp $ - * - *
Many of the methods here return lists of information in ResultSets. You - * can use the normal ResultSet methods such as getString and getInt to - * retrieve the data from these ResultSets. If a given form of metadata is - * not available, these methods should throw a SQLException. - * - *
Some of these methods take arguments that are String patterns. These - * arguments all have names such as fooPattern. Within a pattern String, - * "%" means match any substring of 0 or more characters, and "_" means - * match any one character. Only metadata entries matching the search - * pattern are returned. if a search pattern argument is set to a null - * ref, it means that argument's criteria should be dropped from the - * search. - * - *
A SQLException will be throws if a driver does not support a meta - * data method. In the case of methods that return a ResultSet, either - * a ResultSet (which may be empty) is returned or a SQLException is - * thrown. - * - * @see java.sql.DatabaseMetaData - */ -public class DatabaseMetaData implements java.sql.DatabaseMetaData +public abstract class AbstractJdbc2DatabaseMetaData extends org.postgresql.jdbc1.AbstractJdbc1DatabaseMetaData { - Jdbc2Connection connection; // The connection association - - // These define various OID's. Hopefully they will stay constant. - static final int iVarcharOid = 1043; // OID for varchar - static final int iBoolOid = 16; // OID for bool - static final int iInt2Oid = 21; // OID for int2 - static final int iInt4Oid = 23; // OID for int4 - static final int VARHDRSZ = 4; // length for int4 - public DatabaseMetaData(Jdbc2Connection conn) + public AbstractJdbc2DatabaseMetaData(AbstractJdbc2Connection conn) { - this.connection = conn; + super(conn); } /* @@ -2589,18 +2551,18 @@ WHERE String rule = updateRule.substring(8, updateRule.length() - 4); - int action = importedKeyNoAction; + int action = java.sql.DatabaseMetaData.importedKeyNoAction; if ( rule == null || "noaction".equals(rule) ) - action = importedKeyNoAction; + action = java.sql.DatabaseMetaData.importedKeyNoAction; if ("cascade".equals(rule)) - action = importedKeyCascade; + action = java.sql.DatabaseMetaData.importedKeyCascade; else if ("setnull".equals(rule)) - action = importedKeySetNull; + action = java.sql.DatabaseMetaData.importedKeySetNull; else if ("setdefault".equals(rule)) - action = importedKeySetDefault; + action = java.sql.DatabaseMetaData.importedKeySetDefault; else if ("restrict".equals(rule)) - action = importedKeyRestrict; + action = java.sql.DatabaseMetaData.importedKeyRestrict; tuple[9] = Integer.toString(action).getBytes(); @@ -2613,13 +2575,13 @@ WHERE String rule = updateRule.substring(8, updateRule.length() - 4); - int action = importedKeyNoAction; + int action = java.sql.DatabaseMetaData.importedKeyNoAction; if ("cascade".equals(rule)) - action = importedKeyCascade; + action = java.sql.DatabaseMetaData.importedKeyCascade; else if ("setnull".equals(rule)) - action = importedKeySetNull; + action = java.sql.DatabaseMetaData.importedKeySetNull; else if ("setdefault".equals(rule)) - action = importedKeySetDefault; + action = java.sql.DatabaseMetaData.importedKeySetDefault; tuple[10] = Integer.toString(action).getBytes(); } @@ -2665,15 +2627,15 @@ WHERE tuple[12] = rs.getBytes(5); //PK_NAME // DEFERRABILITY - int deferrability = importedKeyNotDeferrable; + int deferrability = java.sql.DatabaseMetaData.importedKeyNotDeferrable; boolean deferrable = rs.getBoolean(6); boolean initiallyDeferred = rs.getBoolean(7); if (deferrable) { if (initiallyDeferred) - deferrability = importedKeyInitiallyDeferred; + deferrability = java.sql.DatabaseMetaData.importedKeyInitiallyDeferred; else - deferrability = importedKeyInitiallyImmediate; + deferrability = java.sql.DatabaseMetaData.importedKeyInitiallyImmediate; } tuple[13] = Integer.toString(deferrability).getBytes(); @@ -2936,8 +2898,8 @@ WHERE byte b9[] = "9".getBytes(); byte b10[] = "10".getBytes(); byte bf[] = "f".getBytes(); - byte bnn[] = Integer.toString(typeNoNulls).getBytes(); - byte bts[] = Integer.toString(typeSearchable).getBytes(); + byte bnn[] = Integer.toString(java.sql.DatabaseMetaData.typeNoNulls).getBytes(); + byte bts[] = Integer.toString(java.sql.DatabaseMetaData.typeSearchable).getBytes(); while (rs.next()) { @@ -3079,10 +3041,10 @@ WHERE tuple[4] = null; tuple[5] = r.getBytes(3); tuple[6] = r.getBoolean(4) ? - Integer.toString(tableIndexClustered).getBytes() : + Integer.toString(java.sql.DatabaseMetaData.tableIndexClustered).getBytes() : r.getString(5).equals("hash") ? - Integer.toString(tableIndexHashed).getBytes() : - Integer.toString(tableIndexOther).getBytes(); + Integer.toString(java.sql.DatabaseMetaData.tableIndexHashed).getBytes() : + Integer.toString(java.sql.DatabaseMetaData.tableIndexOther).getBytes(); tuple[7] = Integer.toString(i + 1).getBytes(); if (columnNameRS.next()) tuple[8] = columnNameRS.getBytes(1); diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSetMetaData.java b/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java similarity index 95% rename from src/interfaces/jdbc/org/postgresql/jdbc2/ResultSetMetaData.java rename to src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java index d152c5f6dedb6d8b395e908ff0435858cc26a129..c64461607adca27dff0fd5a17faa06ac6c17ccb1 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSetMetaData.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java @@ -1,9 +1,5 @@ package org.postgresql.jdbc2; -// IMPORTANT NOTE: This file implements the JDBC 2 version of the driver. -// If you make any modifications to this file, you must make sure that the -// changes are also made (if relevent) to the related JDBC 1 class in the -// org.postgresql.jdbc1 package. import java.lang.*; import java.sql.*; @@ -11,16 +7,8 @@ import java.util.*; import org.postgresql.*; import org.postgresql.util.*; -/** - * A ResultSetMetaData object can be used to find out about the types and - * properties of the columns in a ResultSet - * - * @see java.sql.ResultSetMetaData - */ -public class ResultSetMetaData implements java.sql.ResultSetMetaData +public abstract class AbstractJdbc2ResultSetMetaData extends org.postgresql.jdbc1.AbstractJdbc1ResultSetMetaData { - Vector rows; - Field[] fields; /* * Initialise for a result with a tuple set and @@ -29,10 +17,9 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData * @param rows the Vector of rows returned by the ResultSet * @param fields the array of field descriptors */ - public ResultSetMetaData(Vector rows, Field[] fields) + public AbstractJdbc2ResultSetMetaData(Vector rows, Field[] fields) { - this.rows = rows; - this.fields = fields; + super(rows, fields); } /* @@ -144,7 +131,7 @@ public class ResultSetMetaData implements java.sql.ResultSetMetaData * defined with NOT NULL or PRIMARY KEY, CHECK constraints, views, * functions etc. */ - return columnNullableUnknown; + return java.sql.ResultSetMetaData.columnNullableUnknown; } /* diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2Connection.java b/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2Connection.java index b512355260c2520d641e58160aaed72f1bc29a11..9e64350f5b5fa4d927c818b82630575e81d753fe 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2Connection.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2Connection.java @@ -6,7 +6,7 @@ import java.util.Vector; import java.util.Hashtable; import org.postgresql.Field; -/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/Jdbc2Connection.java,v 1.3 2002/07/25 22:45:28 barry Exp $ +/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/Jdbc2Connection.java,v 1.4 2002/07/26 05:29:35 barry Exp $ * This class implements the java.sql.Connection interface for JDBC2. * However most of the implementation is really done in * org.postgresql.jdbc2.AbstractJdbc2Connection or one of it's parents @@ -42,7 +42,7 @@ public class Jdbc2Connection extends org.postgresql.jdbc2.AbstractJdbc2Connectio public java.sql.DatabaseMetaData getMetaData() throws SQLException { if (metadata == null) - metadata = new org.postgresql.jdbc2.DatabaseMetaData(this); + metadata = new org.postgresql.jdbc2.Jdbc2DatabaseMetaData(this); return metadata; } diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2DatabaseMetaData.java b/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2DatabaseMetaData.java new file mode 100644 index 0000000000000000000000000000000000000000..2e7171913e7c8eb38480e5df52823ee144cc6bca --- /dev/null +++ b/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2DatabaseMetaData.java @@ -0,0 +1,11 @@ +package org.postgresql.jdbc2; + + +public class Jdbc2DatabaseMetaData extends AbstractJdbc2DatabaseMetaData implements java.sql.DatabaseMetaData +{ + public Jdbc2DatabaseMetaData(Jdbc2Connection conn) + { + super(conn); + } + +} diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2ResultSet.java b/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2ResultSet.java index e2c6ad7eea28bf375030e4354a3106dc9bcaaf28..c6415f0f7ae2784b33580f7f313847f9807f6d4d 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2ResultSet.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2ResultSet.java @@ -5,7 +5,7 @@ import java.sql.*; import java.util.Vector; import org.postgresql.Field; -/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/Jdbc2ResultSet.java,v 1.2 2002/07/25 22:45:28 barry Exp $ +/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/Jdbc2ResultSet.java,v 1.3 2002/07/26 05:29:35 barry Exp $ * This class implements the java.sql.ResultSet interface for JDBC2. * However most of the implementation is really done in * org.postgresql.jdbc2.AbstractJdbc2ResultSet or one of it's parents @@ -20,7 +20,7 @@ public class Jdbc2ResultSet extends org.postgresql.jdbc2.AbstractJdbc2ResultSet public java.sql.ResultSetMetaData getMetaData() throws SQLException { - return new ResultSetMetaData(rows, fields); + return new Jdbc2ResultSetMetaData(rows, fields); } } diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2ResultSetMetaData.java b/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2ResultSetMetaData.java new file mode 100644 index 0000000000000000000000000000000000000000..e0e5a0dc7da1a5f38fca6fa5246ddf620310e90d --- /dev/null +++ b/src/interfaces/jdbc/org/postgresql/jdbc2/Jdbc2ResultSetMetaData.java @@ -0,0 +1,10 @@ +package org.postgresql.jdbc2; + +public class Jdbc2ResultSetMetaData extends AbstractJdbc2ResultSetMetaData implements java.sql.ResultSetMetaData +{ + public Jdbc2ResultSetMetaData(java.util.Vector rows, org.postgresql.Field[] fields) + { + super(rows, fields); + } +} +