View Javadoc

1   
2   package groovy.sql;
3   
4   
5   import java.sql.CallableStatement;
6   import java.sql.ResultSet;
7   import java.sql.SQLException;
8   
9   /***
10   * @author rfuller
11   *
12   * Represents a ResultSet retrieved as a callable statement out parameter.
13   */
14  class CallResultSet extends GroovyResultSet {
15  	int indx;
16  	CallableStatement call;
17  	ResultSet resultSet;
18  	boolean firstCall = true;
19  	
20  	CallResultSet(CallableStatement call, int indx){
21  		this.call = call;
22  		this.indx = indx;
23  	}
24  	
25  	protected ResultSet getResultSet() throws SQLException{
26  		if(firstCall){
27  		    resultSet = (ResultSet) call.getObject(indx+1);
28  			firstCall = false;
29  		}
30  		return resultSet;
31  	}
32  }