commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 22214] New: - Delegating ResultSet causing NPE
Date Thu, 07 Aug 2003 13:10:29 GMT
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.

Mime
View raw message