Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Item Reader in Java ee 7 Batch not working

Sunil907-OracleApr 21 2016 — edited Apr 21 2016

Hi,

I am trying to create Item Reader, Item Processor and Item Writer in Java EE 7 batch in Weblogic 12.2.2. My Item Reader should fetch the data from the database and Processor should consume the data.

For this, i have defined PreparedStatement, ResultSet as a instance variable in Reader. In Open method inside reader, i am fetching the data from database and setting the resultset. In readItem method, i am trying to do resultset.next but there i am getting exception that Resultset is already closed.


Upon debugging, i found that Resultset as well as Prepared Statement both are closed. Because of this i am not able to access the resultset in readItem() method.


Please help, why Prepared Statement and Resultset is getting closed automatically.


Regards,

Sunil



Comments
Post Details
Added on Apr 21 2016
0 comments
519 views