diff options
Diffstat (limited to 'src/interfaces/jdbc/org/postgresql/ResultSet.java')
-rw-r--r-- | src/interfaces/jdbc/org/postgresql/ResultSet.java | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/ResultSet.java b/src/interfaces/jdbc/org/postgresql/ResultSet.java index e601e239eba..cec62614ca4 100644 --- a/src/interfaces/jdbc/org/postgresql/ResultSet.java +++ b/src/interfaces/jdbc/org/postgresql/ResultSet.java @@ -19,6 +19,7 @@ public abstract class ResultSet protected Field fields[]; // The field descriptions protected String status; // Status of the result protected int updateCount; // How many rows did we get back? + protected int insertOID; // The oid of an inserted row protected int current_row; // Our pointer to where we are at protected byte[][] this_row; // the current row result protected Connection connection; // the connection which we returned from @@ -40,17 +41,35 @@ public abstract class ResultSet * @param updateCount the number of rows affected by the operation * @param cursor the positioned update/delete cursor name */ - public ResultSet(Connection conn, Field[] fields, Vector tuples, String status, int updateCount) + public ResultSet(Connection conn, Field[] fields, Vector tuples, String status, int updateCount,int insertOID) { this.connection = conn; this.fields = fields; this.rows = tuples; this.status = status; this.updateCount = updateCount; + this.insertOID = insertOID; this.this_row = null; this.current_row = -1; } + + /** + * Create a new ResultSet - Note that we create ResultSets to + * represent the results of everything. + * + * @param fields an array of Field objects (basically, the + * ResultSet MetaData) + * @param tuples Vector of the actual data + * @param status the status string returned from the back end + * @param updateCount the number of rows affected by the operation + * @param cursor the positioned update/delete cursor name + */ + public ResultSet(Connection conn, Field[] fields, Vector tuples, String status, int updateCount) + { + this(conn,fields,tuples,status,updateCount,0); + } + /** * We at times need to know if the resultSet we are working * with is the result of an UPDATE, DELETE or INSERT (in which @@ -149,6 +168,14 @@ public abstract class ResultSet } /** + * returns the OID of the last inserted row + */ + public int getInsertedOID() + { + return insertOID; + } + + /** * This is part of the JDBC API, but is required by org.postgresql.Field */ public abstract void close() throws SQLException; |