运行错误:com.mysql.jdbc.NotUpdatable: Result Set not updatable.This result set must come
from a statement that was created with a result set type of ResultSet.CONCUR_UPD
ATABLE, the query must select only one table, and must select all primary keys f
rom that table. See the JDBC 2.1 API Specification, section 5.6 for more details
.
at com.mysql.jdbc.ResultSet.updateDouble(ResultSet.java:3100)
我的代码段:
String searchNow_Surplus = "select * from USER where ID=1";
try{
Statement stmt = conn.createStatement();
ResultSet rst = stmt.executeQuery(searchNow_Surplus);
while(rst.next())
{
test = test - Cost_Rate;
rst.updateDouble("NOW_SURPLUS",test);
rst.updateRow();
i++;
}
请问这是为什么呢? |