由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - java database access problem!!!
相关主题
问个SQL的问题[转载] question about SQL in Access
问个数据库问题求助:SQL05 Backup Error
how to get the result in the middle of resultset?Access 'memo' data type
java sql help!Help for VB 6 and MS Access DB
Java SQL --> resultset!!mySQL怎么这么慢?
SQL Server Update Query - non-unique value如果publish一个access database on the web?
MSSQL 怎么解决内存是释放的问题?How to improve performance of Database?
关于not closed cursor的请教关于DATABASE 的研究方向
相关话题的讨论汇总
话题: update话题: query话题: resultset话题: database话题: problem
进入Database版参与讨论
1 (共1页)
i*****t
发帖数: 220
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.
e**o
发帖数: 131
2
your code must be within a try block and r is closed automatically when either
the Connection object or the Statement object is closed, which is highly
likely in some catch or finally clause.

says

【在 i*****t 的大作中提到】
: 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);
: ...
: }

1 (共1页)
进入Database版参与讨论
相关主题
关于DATABASE 的研究方向Java SQL --> resultset!!
How to design a database model related to six degree of separation?SQL Server Update Query - non-unique value
一个关于 通过Matlab databast toolbox 获得MySQL数据的问题,两个机器,谢谢!MSSQL 怎么解决内存是释放的问题?
query analyzer VS. Stored procedure关于not closed cursor的请教
问个SQL的问题[转载] question about SQL in Access
问个数据库问题求助:SQL05 Backup Error
how to get the result in the middle of resultset?Access 'memo' data type
java sql help!Help for VB 6 and MS Access DB
相关话题的讨论汇总
话题: update话题: query话题: resultset话题: database话题: problem