81,092
社区成员
发帖
与我相关
我的任务
分享
boolean getMoreResults()
throws SQLException
Moves to this Statement object's next result, returns true if it is a ResultSet object, and implicitly closes any current ResultSet object(s) obtained with the method getResultSet.
There are no more results when the following is true:
// stmt is a Statement object
((stmt.getMoreResults() == false) && (stmt.getUpdateCount() == -1))
String sql="{CALL test_proc()}";
CallableStatement cstm=con.prepareCall(sql);
value=cstm.execute();
while(value){
rs=cstm.getResultSet(); //取得第一个结果集
if(rs.next){
System.out.println(rs.getInt(1));//打印出结果集的第一个字段
}
value=cstm.getMoreResultSet();//继续去取结果集
}