01: package groovy.sql;
02:
03: import java.sql.CallableStatement;
04: import java.sql.ResultSet;
05: import java.sql.SQLException;
06:
07: /**
08: * @author rfuller
09: *
10: * Represents a ResultSet retrieved as a callable statement out parameter.
11: */
12: class CallResultSet extends GroovyResultSet {
13: int indx;
14: CallableStatement call;
15: ResultSet resultSet;
16: boolean firstCall = true;
17:
18: CallResultSet(CallableStatement call, int indx) {
19: this .call = call;
20: this .indx = indx;
21: }
22:
23: protected ResultSet getResultSet() throws SQLException {
24: if (firstCall) {
25: resultSet = (ResultSet) call.getObject(indx + 1);
26: firstCall = false;
27: }
28: return resultSet;
29: }
30: }
|