java database access problem!!!# Database - 数据库
i*t
1 楼
I use two database accessing methods in a loop like:
while ()
{
...
query = "select ...";
ResultSet r = statement.executeQuery(query);
update = "update...";
int ud = statement.executeUpdate(update);
...
}
The first query has no problem. No compiling errors. But when it runs, it says
the update method does not work because "ResultSet is closed." What is wrong
with it and how to fix it? Thanks.
while ()
{
...
query = "select ...";
ResultSet r = statement.executeQuery(query);
update = "update...";
int ud = statement.executeUpdate(update);
...
}
The first query has no problem. No compiling errors. But when it runs, it says
the update method does not work because "ResultSet is closed." What is wrong
with it and how to fix it? Thanks.