diff options
author | Dave Cramer <davec@fastcrypt.com> | 2002-03-05 18:02:44 +0000 |
---|---|---|
committer | Dave Cramer <davec@fastcrypt.com> | 2002-03-05 18:02:44 +0000 |
commit | 29ea8ff9b13f7e4e42d18a04a46e5cc3d8f9cfd2 (patch) | |
tree | ed794d1ab91d5824d0e2115994eab8a6e2a5e163 /src/interfaces/jdbc/org/postgresql/ResultSet.java | |
parent | ff2f9b663f73b020cc5f8fa05d848a6f6d33c6ac (diff) | |
download | postgresql-29ea8ff9b13f7e4e42d18a04a46e5cc3d8f9cfd2.tar.gz |
Patch by Nicolas Verger to correctly propogate SQLWarning to the Statement and ResultSet
Diffstat (limited to 'src/interfaces/jdbc/org/postgresql/ResultSet.java')
-rw-r--r-- | src/interfaces/jdbc/org/postgresql/ResultSet.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/ResultSet.java b/src/interfaces/jdbc/org/postgresql/ResultSet.java index a9da22d4f4..768a489e6f 100644 --- a/src/interfaces/jdbc/org/postgresql/ResultSet.java +++ b/src/interfaces/jdbc/org/postgresql/ResultSet.java @@ -223,5 +223,37 @@ public abstract class ResultSet return s; } + + /** + * The first warning reported by calls on this ResultSet is + * returned. Subsequent ResultSet warnings will be chained + * to this SQLWarning. + * + * <p>The warning chain is automatically cleared each time a new + * row is read. + * + * <p><B>Note:</B> This warning chain only covers warnings caused by + * ResultSet methods. Any warnings caused by statement methods + * (such as reading OUT parameters) will be chained on the + * Statement object. + * + * @return the first SQLWarning or null; + * @exception SQLException if a database access error occurs. + */ + public SQLWarning getWarnings() throws SQLException + { + return warnings; + } + + /** + * Add a warning chain to the current warning chain + * @param warnings warnings to add + */ + public void addWarnings(SQLWarning warnings) { + if ( this.warnings != null ) + this.warnings.setNextWarning(warnings); + else + this.warnings = warnings; + } } |