我有一個小問題。我啓動我的應用程序,並啓動查詢和比較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
。