You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Bret Gregory (JIRA)" <ib...@incubator.apache.org> on 2005/11/17 18:01:42 UTC

[jira] Commented: (IBATIS-220) Null Pointer in SqlExecutor.handleResults where ResultSet is null.

    [ http://issues.apache.org/jira/browse/IBATIS-220?page=comments#action_12357908 ] 

Bret Gregory commented on IBATIS-220:
-------------------------------------

Okay, I have done a little more digging into the problem.  The problem is caused by the SqlExecutor.executeQueryProcedure(...) on line 287.
The change between iBatis 2.0.9 and iBatis 2.1.5 is the call on the CallableStatement changed from cs.executeQuery() which always returns a ResultSet to cs.execute().  Then the ResultSet is fetched from the callable statement, but this is null.  

The change should be to change the cs.execute() back to cs.executeQuery().  I am surprised that more people haven't run into this problem.  

Hope this helps.  
-Bret


> Null Pointer in SqlExecutor.handleResults where ResultSet is null.
> ------------------------------------------------------------------
>
>          Key: IBATIS-220
>          URL: http://issues.apache.org/jira/browse/IBATIS-220
>      Project: iBatis for Java
>         Type: Bug
>     Versions: 2.1.5, 2.1.6
>  Environment: Windows XP Pro
> MS SQL Server
>     Reporter: Bret Gregory

>
> I recently ran into a problem while executing a stored procedure using an inline map in iBatis 2.1.5_582.  I tested this in 2.1.6_592 to see if the problem was resolved and I am still running into the issue.  I am not sure if this is specific to the JDBC implementation for my SQL Server driver or not.  
> Caused by: java.lang.NullPointerException
>         at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:355)
>         at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQueryProcedure(SqlExecutor.java:291)
>         at com.ibatis.sqlmap.engine.mapping.statement.ProcedureStatement.sqlExecuteQuery(ProcedureStatement.java:34)
>         at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:173)
> The problem looks to be caused by the callable statement not returning a result set in the executeQueryProcedure method.  The rs variable is set to null and passed into the handleResults() method.  This method attempts to get the Type, and the Null Pointer is thrown.  
> This looks like a bug and this code executes normally in iBatis 2.0.9.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira