Hello there. Is it possible to process a JDBC ResultSet more than once. What I mean is that I want to pass a single result set argument to two different methods that both process the result set in its entirety. Code looks as follows:
Hi Joe, It is possible to process a resultset more than once,if the resultset is scrollable.By default resultsets are forward only,so in that case you can not process more than once.If the mentioned 2 methods are running in threads using same resultset objects,or objects pointing to same resultset,then the repurcations are not known. ideally one should store the data in a simple java bean and do the further processing on the same. Let me know your thoughts.
We're pleased to have you here with us in the JDBC forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.
In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.
Hi Samir. Thanks a lot for your reply. I have a little experience with Java beans and from what I hear they are not too difficult to master. However given the choice of employing either a scrollable resultset or using java beans I think I would rather go with the scrollable resultset option. can you give me some advice on how to incorporate the scrollable resultset or where to find some sample code on scrollable resultsets. Thnaks a lot, Joe