This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I went thru' the earlier question posted on the forum and applied all the workaround fixes in my code but I am still seeing this issue. Can anybody help me?
When I make this query I get one row returned from the sqlplus prompt.
I also tried using the column name instead of int 1 in getObject. Also how can I make sure that I close all the earlier resultsets and statement called from this code?
This is the stacktrace till my class it called:
java.sql.SQLException: Exhausted Resultset
at weblogic.jdbc.wrapper.ResultSet_oracle_jdbc_driver_OracleResultSetImpl.getObject(Unknown Source)
That exception tells me that the query returned zero records (not one record, but zero). Calling "rs.next()" moved the result set cursor to the end of file, since there were no records. Then trying to use the record at that cursor location caused the exception to be thrown.
As for making sure the result set is closed, you should put the "rs.close()" call, and the others, into a finally block. Here's a link to Sun's tutorial about that: