我有一个小问题。我启动我的应用程序,并启动查询和比较rs == null
后,我得到错误ResultSet is closed
。ResultSet已关闭。为什么?
下面是代码:
error_code = NO_ERROR;
try
{
ArrayList <Harmonogram> al = new ArrayList <Harmonogram>();
ResultSet rs = stat.executeQuery(myQuery);
if (rs == null)
{
return null;
}else{
Harmonogram harm = new Harmonogram(rs.getLong(1), rs.getInt(2), rs.getInt(3), rs.getInt(4), rs.getLong(5), rs.getString(6));
在此之后,我收到了SQLException
告诉我:ResultSet is closed
。