summaryrefslogtreecommitdiff
path: root/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
diff options
context:
space:
mode:
authorBarry Lind <barry@xythos.com>2003-09-08 17:30:22 +0000
committerBarry Lind <barry@xythos.com>2003-09-08 17:30:22 +0000
commit0378a269f3ab3c44e67b14f96414b6ca95263263 (patch)
treee6067a398b5253387aa0555ddf88eab80d0e8b4e /src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
parente702b04cf41bf2df633cc72cd60b6f3019c912d0 (diff)
downloadpostgresql-0378a269f3ab3c44e67b14f96414b6ca95263263.tar.gz
This set of changes applies a patch from KHO at redhat to add some SQLState
support to the jdbc driver. That patch needed some work: it assumed the sqlcode in a server message was fixed in its position, the patch lost the ability to pass exceptions, and the patch missed a couple of places where server errors where being received. In addition to fixing the above, I also added full support for the V3 protocol error message syntax, I reversed the order of arguments in the PSQLException constructor to more closely follow the constructors for SQLException, I changed the new constructors that take PSQLState to take Object for additional parameters as the old ones did. Still todo are to add SQLState values to all existing exceptions thrown in the driver and add support for parsing the V3 protocol format for notices. Modified Files: jdbc/build.xml jdbc/org/postgresql/Driver.java.in jdbc/org/postgresql/errors.properties jdbc/org/postgresql/core/Encoding.java jdbc/org/postgresql/core/PGStream.java jdbc/org/postgresql/core/QueryExecutor.java jdbc/org/postgresql/fastpath/Fastpath.java jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSet.java jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java jdbc/org/postgresql/util/MessageTranslator.java jdbc/org/postgresql/util/PSQLException.java
Diffstat (limited to 'src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java')
-rw-r--r--src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java b/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
index d06adb543f..3921516928 100644
--- a/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
+++ b/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
@@ -9,7 +9,7 @@
* Copyright (c) 2003, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2ResultSet.java,v 1.21 2003/08/11 21:33:50 barry Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2ResultSet.java,v 1.22 2003/09/08 17:30:22 barry Exp $
*
*-------------------------------------------------------------------------
*/
@@ -30,6 +30,7 @@ import org.postgresql.core.BaseStatement;
import org.postgresql.core.Field;
import org.postgresql.core.Encoding;
import org.postgresql.util.PSQLException;
+import org.postgresql.util.PSQLState;
public abstract class AbstractJdbc2ResultSet extends org.postgresql.jdbc1.AbstractJdbc1ResultSet
@@ -421,7 +422,7 @@ public abstract class AbstractJdbc2ResultSet extends org.postgresql.jdbc1.Abstra
public Ref getRef(int i) throws SQLException
{
//The backend doesn't yet have SQL3 REF types
- throw new PSQLException("postgresql.psqlnotimp");
+ throw new PSQLException("postgresql.psqlnotimp", PSQLState.NOT_IMPLEMENTED);
}
@@ -513,7 +514,7 @@ public abstract class AbstractJdbc2ResultSet extends org.postgresql.jdbc1.Abstra
public void setFetchDirection(int direction) throws SQLException
{
- throw new PSQLException("postgresql.psqlnotimp");
+ throw new PSQLException("postgresql.psqlnotimp", PSQLState.NOT_IMPLEMENTED);
}