I\'m trying to execute the getPendingSalesOrderIDs() method which calls upon method selectInAsending(...).
But this shows a SQLException saying java.sql.SQLException:
If db.endSelect()
closes your ResultSet, why not remove it (in the selectInAsending()
method)?
You can close your ResultSet in the getPendingSalesOrderIDs()
method like so:
ResultSet r = null;
try {
ResultSet r = salesOrder.selectInAsending("soNo", "productionStatus = 'pending' and formatID='Zn-Al'", "soNo");
} catch (SQLException e) {
} finally {
if (r != null) {
try {
r.close();
} catch (SQLException e) {
}
}
}
Yes, the problem is with the db.endSelect()
call.
Just return the resultset, and then be sure to call rs.close()
once you are finished. This will take care of cleaning things up.