Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.5.7
-
None
-
Windows XP SP3
Description
Using eachRow and passing parameters containing resultsets will fail.
The eachRow method will instantiate a PreparedStatement and use setParameters and then setObject,
which will result in a ClassCastException (catched in line 1416), because it tries to cast to a CallableStatement.
But there is no eachRow-Method with a CallableStatement...
Workaround:
use Sql.call and make sure your resultsets get closed explicitly, after executing your statement (you just got a feature request )
A possible solution would be to detect OutParameters and then use a CallableStatement.
If ResultSetOutParameters are used, a modified Sql.call function that cleans up resultsets as well could be used.
You could also close the ResultSets in the eachRow method after calling the "current" call-Method.... adeveloper would still have to clean up ResultSets using the call-method though.
Attachments
Issue Links
- relates to
-
GROOVY-3137 Groovy SQL call, eachRow and Resultset in parameters
- Closed