You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2003/08/07 15:10:29 UTC
DO NOT REPLY [Bug 22214] New: -
Delegating ResultSet causing NPE
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22214>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22214
Delegating ResultSet causing NPE
Summary: Delegating ResultSet causing NPE
Product: Commons
Version: unspecified
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: Major
Priority: Other
Component: Dbcp
AssignedTo: commons-dev@jakarta.apache.org
ReportedBy: marc@anyware.co.uk
If you execute a query that would result in a NULL ResultSet, DBCP still
produces a delegating resultset instance, with a null _res member field.
Therefore this breaks the contract of Statement.getResultSet which is permitted
to return null in this condition.
Also, because you cannot tell the ResultSet was null because you get a delegated
one, so you have no choice but to have your code clean up nicely - but any
methods called cause an NPE - i.e. rs.next(), rs.close() - because of this
problem.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org