mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
Initial restructuring to add jdbc3 support. There was a significant amount
of duplicated code between the jdbc1 and jdbc2. This checkin restructures the code so that the duplication is removed so that the jdbc3 support can be added without adding yet another copy of everything. Also many classes were renamed to avoid confusion with multiple different objects having the same name. The timestamp tests were also updated to add support for testing timestamp without time zone in addition to timestamp with time zone Modified Files: jdbc/Makefile jdbc/build.xml jdbc/example/ImageViewer.java jdbc/example/basic.java jdbc/example/blobtest.java jdbc/example/threadsafe.java jdbc/org/postgresql/Driver.java.in jdbc/org/postgresql/Field.java jdbc/org/postgresql/core/QueryExecutor.java jdbc/org/postgresql/fastpath/Fastpath.java jdbc/org/postgresql/jdbc1/CallableStatement.java jdbc/org/postgresql/jdbc1/DatabaseMetaData.java jdbc/org/postgresql/jdbc1/PreparedStatement.java jdbc/org/postgresql/jdbc2/Array.java jdbc/org/postgresql/jdbc2/CallableStatement.java jdbc/org/postgresql/jdbc2/DatabaseMetaData.java jdbc/org/postgresql/jdbc2/PreparedStatement.java jdbc/org/postgresql/jdbc2/UpdateableResultSet.java jdbc/org/postgresql/largeobject/LargeObjectManager.java jdbc/org/postgresql/largeobject/PGblob.java jdbc/org/postgresql/largeobject/PGclob.java jdbc/org/postgresql/test/jdbc2/BlobTest.java jdbc/org/postgresql/test/jdbc2/ConnectionTest.java jdbc/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java jdbc/org/postgresql/test/jdbc2/TimestampTest.java jdbc/org/postgresql/test/jdbc2/UpdateableResultTest.java jdbc/org/postgresql/util/Serialize.java Added Files: jdbc/org/postgresql/PGConnection.java jdbc/org/postgresql/PGStatement.java jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSet.java jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java jdbc/org/postgresql/jdbc1/Jdbc1Connection.java jdbc/org/postgresql/jdbc1/Jdbc1ResultSet.java jdbc/org/postgresql/jdbc1/Jdbc1Statement.java jdbc/org/postgresql/jdbc2/AbstractJdbc2Connection.java jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java jdbc/org/postgresql/jdbc2/Jdbc2Connection.java jdbc/org/postgresql/jdbc2/Jdbc2ResultSet.java jdbc/org/postgresql/jdbc2/Jdbc2Statement.java Removed Files: jdbc/org/postgresql/Connection.java jdbc/org/postgresql/ResultSet.java jdbc/org/postgresql/Statement.java jdbc/org/postgresql/jdbc1/Connection.java jdbc/org/postgresql/jdbc1/ResultSet.java jdbc/org/postgresql/jdbc1/Statement.java jdbc/org/postgresql/jdbc2/Connection.java jdbc/org/postgresql/jdbc2/ResultSet.java jdbc/org/postgresql/jdbc2/Statement.java
This commit is contained in:
@ -1,9 +1,7 @@
|
||||
package org.postgresql.jdbc2;
|
||||
|
||||
// IMPORTANT NOTE: This is the begining of supporting updateable ResultSets.
|
||||
// It is not a working solution (yet)!
|
||||
//
|
||||
// You will notice here we really do throw org.postgresql.Driver.notImplemented()
|
||||
// This is because here we should be updateable, so any unimplemented methods
|
||||
// must say so.
|
||||
//
|
||||
@ -27,7 +25,7 @@ import org.postgresql.Driver;
|
||||
* @see ResultSetMetaData
|
||||
* @see java.sql.ResultSet
|
||||
*/
|
||||
public class UpdateableResultSet extends org.postgresql.jdbc2.ResultSet
|
||||
public class UpdateableResultSet extends org.postgresql.jdbc2.Jdbc2ResultSet
|
||||
{
|
||||
|
||||
|
||||
@ -118,7 +116,7 @@ public class UpdateableResultSet extends org.postgresql.jdbc2.ResultSet
|
||||
* @param updateCount the number of rows affected by the operation
|
||||
* @param cursor the positioned update/delete cursor name
|
||||
*/
|
||||
public UpdateableResultSet(Connection conn, Field[] fields, Vector tuples, String status, int updateCount, long insertOID, boolean binaryCursor)
|
||||
public UpdateableResultSet(Jdbc2Connection conn, Field[] fields, Vector tuples, String status, int updateCount, long insertOID, boolean binaryCursor)
|
||||
{
|
||||
super(conn, fields, tuples, status, updateCount, insertOID, binaryCursor);
|
||||
}
|
||||
@ -274,7 +272,7 @@ public class UpdateableResultSet extends org.postgresql.jdbc2.ResultSet
|
||||
{
|
||||
// we have to get the last inserted OID and put it in the resultset
|
||||
|
||||
long insertedOID = ((org.postgresql.Statement)insertStatement).getLastOID();
|
||||
long insertedOID = ((AbstractJdbc2Statement)insertStatement).getLastOID();
|
||||
|
||||
updateValues.put("oid", new Long(insertedOID) );
|
||||
|
||||
@ -670,7 +668,7 @@ public class UpdateableResultSet extends org.postgresql.jdbc2.ResultSet
|
||||
selectStatement.setObject( i, ((PrimaryKey)primaryKeys.get(j)).getValue() );
|
||||
}
|
||||
|
||||
org.postgresql.jdbc2.ResultSet rs = (org.postgresql.jdbc2.ResultSet) selectStatement.executeQuery();
|
||||
Jdbc2ResultSet rs = (Jdbc2ResultSet) selectStatement.executeQuery();
|
||||
|
||||
if( rs.first() )
|
||||
{
|
||||
@ -1274,7 +1272,7 @@ public class UpdateableResultSet extends org.postgresql.jdbc2.ResultSet
|
||||
else
|
||||
{
|
||||
// otherwise go and get the primary keys and create a hashtable of keys
|
||||
java.sql.ResultSet rs = ((org.postgresql.jdbc2.Connection)connection).getMetaData().getPrimaryKeys("","",tableName);
|
||||
java.sql.ResultSet rs = ((java.sql.Connection)connection).getMetaData().getPrimaryKeys("","",tableName);
|
||||
|
||||
|
||||
for( ; rs.next(); i++ )
|
||||
|
Reference in New Issue
Block a user