Rather than having complex SQL queries, tries, catch and finals everywhere in the code I have a method execute(SQL, up to three inputs) however if trying to access the ResultsSet this produces outside of the execute you get the error:
"Operation not allowed after ResultSet closed"
Which is because when you close the PreparedStatement it closes the ResultsSetToo (and there seems to be no way around it).
Is there a way to fix this? The only thing I could think of was converting it to an array which is stored
Many thanks for your time,
I have encountered the same problem in the past. Now i use this method:
Instead of returning a
ResultSet, it returns a list of Maps(each one representing 1 row). The first String is the column Label, and the second is the column’s value. I hope it helps. 🙂