summaryrefslogtreecommitdiff
path: root/src/interfaces/jdbc/postgresql/jdbc2/ResultSet.java
diff options
context:
space:
mode:
authorMarc G. Fournier <scrappy@hub.org>1999-01-25 21:22:06 +0000
committerMarc G. Fournier <scrappy@hub.org>1999-01-25 21:22:06 +0000
commit2ee522954d0d634d520e6f10454a8c63ef004a00 (patch)
tree2b1b3b0756fb3ad81d689008dd5465cbd1c56389 /src/interfaces/jdbc/postgresql/jdbc2/ResultSet.java
parent1401f63dd15fbc073775fb0279c3b7153ef95f66 (diff)
downloadpostgresql-2ee522954d0d634d520e6f10454a8c63ef004a00.tar.gz
From: Peter T Mount <peter@retep.org.uk>
This implements some of the JDBC2 methods, fixes a bug introduced into the JDBC1 portion of the driver, and introduces a new example, showing how to use the CORBA ORB thats in Java2 with JDBC. The Tar file contains the new files, the diff the changes to the others. CHANGELOG is separate as I forgot to make a .orig ;-)
Diffstat (limited to 'src/interfaces/jdbc/postgresql/jdbc2/ResultSet.java')
-rw-r--r--src/interfaces/jdbc/postgresql/jdbc2/ResultSet.java26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/interfaces/jdbc/postgresql/jdbc2/ResultSet.java b/src/interfaces/jdbc/postgresql/jdbc2/ResultSet.java
index 9790dac4aa..54e1081a8e 100644
--- a/src/interfaces/jdbc/postgresql/jdbc2/ResultSet.java
+++ b/src/interfaces/jdbc/postgresql/jdbc2/ResultSet.java
@@ -789,9 +789,12 @@ public class ResultSet extends postgresql.ResultSet implements java.sql.ResultSe
// ** JDBC 2 Extensions **
- public boolean absolute(int row) throws SQLException
+ public boolean absolute(int index) throws SQLException
{
- throw postgresql.Driver.notImplemented();
+ if (index < 0 || index > rows.size())
+ return false;
+ this_row = (byte [][])rows.elementAt(index);
+ return true;
}
public void afterLast() throws SQLException
@@ -816,7 +819,11 @@ public class ResultSet extends postgresql.ResultSet implements java.sql.ResultSe
public boolean first() throws SQLException
{
- throw postgresql.Driver.notImplemented();
+ if (rows.size() <= 0)
+ return false;
+ current_row = 0;
+ this_row = (byte [][])rows.elementAt(current_row);
+ return true;
}
public Array getArray(String colName) throws SQLException
@@ -941,7 +948,7 @@ public class ResultSet extends postgresql.ResultSet implements java.sql.ResultSe
public int getRow() throws SQLException
{
- throw postgresql.Driver.notImplemented();
+ return current_row;
}
// This one needs some thought, as not all ResultSets come from a statement
@@ -982,7 +989,11 @@ public class ResultSet extends postgresql.ResultSet implements java.sql.ResultSe
public boolean last() throws SQLException
{
- throw postgresql.Driver.notImplemented();
+ if (rows.size() <= 0)
+ return false;
+ current_row = rows.size() - 1;
+ this_row = (byte [][])rows.elementAt(current_row);
+ return true;
}
public void moveToCurrentRow() throws SQLException
@@ -997,7 +1008,10 @@ public class ResultSet extends postgresql.ResultSet implements java.sql.ResultSe
public boolean previous() throws SQLException
{
- throw postgresql.Driver.notImplemented();
+ if (--current_row < 0)
+ return false;
+ this_row = (byte [][])rows.elementAt(current_row);
+ return true;
}
public void refreshRow() throws SQLException