import java.sql.*;
import java.util.Date;class task4
{
public static void main (String args [])
throws SQLException, ClassNotFoundException
{
// Load the Oracle JDBC driver
Class.forName ("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection
       ("jdbc:oracle:thin:@data-pc33.cs.uow.edu.au:1521:db",  "CSCI317", "CSCI317");
try{
Statement stmt1 = conn.createStatement ();
String query1 = "SELECT LINEITEM.L_ORDERKEY, SUM(PART.P_RETAILPRICE) " +
"FROM LINEITEM JOIN PART " +
"ON LINEITEM.L_PARTKEY = PART.P_PARTKEY " +
"GROUP BY LINEITEM.L_ORDERKEY " +
"HAVING SUM(PART.P_RETAILPRICE) > 10000";
String query2 = "UPDATE ORDERS SET ORDERS.O_TOTALPRICE = ? WHERE ORDERS.O_ORDERKEY = ?";
PreparedStatement pstmt1 = conn.prepareStatement ( query2 );

Date start_time = new Date();
ResultSet rset1 = stmt1.executeQuery(query1);

System.out.println("query");
int i = 0;
while(rset1.next())
{
int okey = rset1.getInt(1);
double price = rset1.getDouble(2);
if(i%100 == 0)
System.out.println(okey + " + " + price);
price = 1.1*price;
pstmt1.setDouble(1, price);
pstmt1.setInt(2, okey);
pstmt1.executeUpdate();
if(i%100 == 0)
System.out.println("3");
i++;
}
System.out.println( i + " rows updated." );
Date stop_time = new Date();
double etime = (stop_time.getTime() - start_time.getTime());
System.out.println("\nElapsed Time = " + etime + " milliseconds\n");
}
catch (SQLException e )
{
String errmsg = e.getMessage();
System.out.println( errmsg );
}
}
}stmt1运行正常,之后进入while后,一到pstmt1.executeUpdate();这里,就停住了,求助