Dyamic查询执行

时间:2016-04-21 11:55:33

标签: java mysql jdbc

我想做以下

Statement St =con.createstatement();
Resultset RS=St.executeQuery("select *from table );
while(RS.next()){
     Temp=RS.getInt("number");
}

我想在同一个while循环中运行另一个查询

Statement St =con.createstatement();
Resultset RS=St.executeQuery("select * from table );
While (RS.next ()){
   Temp=RS.getInt("number");
    RS=St.executeQuery("select * from table2 where number= temp );
}

0 个答案:

没有答案