I’ve got a small problem. I launch my application and after launching a query and comparing rs == null I get error ResultSet is closed.
Here is the code:
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));
After this I get a SQLException telling me: ResultSet is closed.
You are using incorrect method of checking whether
ResultSethas any data.Instead of
use