summaryrefslogtreecommitdiff
path: root/src/interfaces/jdbc/org/postgresql/jdbc2/Connection.java
diff options
context:
space:
mode:
authorBarry Lind <barry@xythos.com>2001-11-25 23:26:59 +0000
committerBarry Lind <barry@xythos.com>2001-11-25 23:26:59 +0000
commit4bc8c8dd95367a1dd0e9af3f1805bb85018ec307 (patch)
treecb1ae41232cde0100e91e4c74e382f0db1de497a /src/interfaces/jdbc/org/postgresql/jdbc2/Connection.java
parent23b5ca91aa92abf518fe1e86eb2b7b478414192b (diff)
downloadpostgresql-4bc8c8dd95367a1dd0e9af3f1805bb85018ec307.tar.gz
This patch fixes a bug reported by Graham Leggett (minfrin@sharp.fm).
The bug was that any insert or update would fail if the returned oid was larger than a signed int. Since OIDs are unsigned int's it was a bug that the code used a java signed int to deal with the values. The bug would result in the error message: "Unable to fathom update count". While fixing the bug, it became apparent that other code made a similar assumption about OIDs being signed ints. Therefore some methods that returned or took OIDs are arguements also needed to be changed. Since we are so close to the 7.2 release I have added new methods that return longs and deprecated the old methods returning ints. Therefore all old code should still work without requiring a code change to cast from long to int. Also note that the methods below are PostgreSQL specific extensions to the JDBC api are are not part of the spec from Sun, thus it is unlikely that they are used much or at all. The deprecated methods are: ResultSet.getInsertedOID() Statement.getInsertedOID() Serialize.store() Connection.putObject() and are replaced by: ResultSet.getLastOID() Statement.getLastOID() Serialize.storeObject() Connection.storeObject() All the deprecated methods returned int, while their replacements return long This patch also fixes two comments in MD5Digest that the author Jeremy Wohl submitted. --Barry
Diffstat (limited to 'src/interfaces/jdbc/org/postgresql/jdbc2/Connection.java')
-rw-r--r--src/interfaces/jdbc/org/postgresql/jdbc2/Connection.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/Connection.java b/src/interfaces/jdbc/org/postgresql/jdbc2/Connection.java
index 19795840ef..355c240fab 100644
--- a/src/interfaces/jdbc/org/postgresql/jdbc2/Connection.java
+++ b/src/interfaces/jdbc/org/postgresql/jdbc2/Connection.java
@@ -17,7 +17,7 @@ import org.postgresql.largeobject.*;
import org.postgresql.util.*;
/*
- * $Id: Connection.java,v 1.15 2001/11/19 22:33:38 momjian Exp $
+ * $Id: Connection.java,v 1.16 2001/11/25 23:26:59 barry Exp $
*
* A Connection represents a session with a specific database. Within the
* context of a Connection, SQL statements are executed and results are
@@ -207,7 +207,7 @@ public class Connection extends org.postgresql.Connection implements java.sql.Co
* This overides the method in org.postgresql.Connection and returns a
* ResultSet.
*/
- public java.sql.ResultSet getResultSet(org.postgresql.Connection conn, java.sql.Statement stat, Field[] fields, Vector tuples, String status, int updateCount, int insertOID, boolean binaryCursor) throws SQLException
+ public java.sql.ResultSet getResultSet(org.postgresql.Connection conn, java.sql.Statement stat, Field[] fields, Vector tuples, String status, int updateCount, long insertOID, boolean binaryCursor) throws SQLException
{
// In 7.1 we now test concurrency to see which class to return. If we are not working with a
// Statement then default to a normal ResultSet object.