Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.5.7
-
Fix Version/s: 1.6.5
-
Component/s: SQL processing
-
Labels:None
-
Environment:Windows XP SP3
-
Number of attachments :
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.
Issue Links
- relates to
-
GROOVY-3137
Groovy SQL call, eachRow and Resultset in parameters
-