1、创建
begin
select * from yewu_hetong;
end
额外的方案
begin
create temporary table tmp1 like t;
insert into tmp1 select * from t;
create temporary table tmp2 like t;
insert into tmp2 select * from t;
end;
ps.....MySQL只能获取前10个结果集,如果有多余的,请自行用代码获取
2、获取
con = Mytest.getConn(); //获取连接
String sql = "{call test()}";
cs = con.prepareCall(sql);
boolean hadResults = cs.execute();
int i=0;
while (hadResults) {
System.out.println(++i);
ResultSet rs = cs.getResultSet();
while (rs != null && rs.next()) {
String name= rs.getString(1);
System.out.println(name);
}
hadResults = cs.getMoreResults(); //检查是否存在更多结果集
}