diff options
author | Marc G. Fournier <scrappy@hub.org> | 1998-04-18 18:32:44 +0000 |
---|---|---|
committer | Marc G. Fournier <scrappy@hub.org> | 1998-04-18 18:32:44 +0000 |
commit | b542fa1a6e838d3e32857cdfbe8aeff940a91c74 (patch) | |
tree | c9a93d39e6a88df94b25cdb336b7a95a14665116 /src/interfaces/jdbc/postgresql/ResultSet.java | |
parent | 87d96ed6725c5a95ca618937f6fdd762b599b9e9 (diff) | |
download | postgresql-REL6_3_2.tar.gz postgresql-REL6_3_2.zip |
From: Peter T Mount <patches@maidast.demon.co.uk>REL6_3_2
This fixes a problem in ResultSet.getDate() when the column is NULL
(reported by Vincent Partington <Vincent.Partington@nmg.nl>)
And fixes a problem with Field's (ResultSet.getObject() was proving to be
slow as it repetedly send queries for oid -> name mapping - fixed by
creating a cache. (reported by Mario Ellebrecht <ellebrec@nads.de>)
Diffstat (limited to 'src/interfaces/jdbc/postgresql/ResultSet.java')
-rw-r--r-- | src/interfaces/jdbc/postgresql/ResultSet.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/interfaces/jdbc/postgresql/ResultSet.java b/src/interfaces/jdbc/postgresql/ResultSet.java index f8eea22595e..ba98bd97c91 100644 --- a/src/interfaces/jdbc/postgresql/ResultSet.java +++ b/src/interfaces/jdbc/postgresql/ResultSet.java @@ -398,6 +398,8 @@ public class ResultSet implements java.sql.ResultSet public java.sql.Date getDate(int columnIndex) throws SQLException { String s = getString(columnIndex); + if(s==null) + return null; SimpleDateFormat df = new SimpleDateFormat(connection.getDateStyle()); try { return new java.sql.Date(df.parse(s).getTime()); @@ -856,5 +858,28 @@ public class ResultSet implements java.sql.ResultSet { return fields.length; } + + /** + * Returns the status message from the backend.<p> + * It is used internally by the driver. + * + * @return the status string from the backend + */ + public String getStatusString() + { + return status; + } + + /** + * returns the OID of a field.<p> + * It is used internally by the driver. + * + * @param field field id + * @return the oid of that field's type + */ + public int getColumnOID(int field) + { + return fields[field-1].getOID(); + } } |