cancel
Showing results for 
Search instead for 
Did you mean: 

how unprocessed result set is handled on statment.close

Former Member
0 Kudos
3,750

Hi

I have an issue. We were using jconn3 in our legacy application, in it, we do call statement.close and were able to use result Set mapped to that statement afterwards. Of course, the result set had only select statement.

Now when we move to Jconn4 , we are getting an error as "Result set already been closed".

Ideally we should have got that error even in Jconn3 , so i am confused why the different behavior? We have same code the only change is driver.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member

JConnect did not always know about or was unable utilize cursors in the database server and so, tended to fetch the entire result set to simulate cursor operations using client side buffers and gears. Either way your ability to access the result set after the statement is dependent upone that. I.E. Your current code seems to be expecting behaviour something more like (javax.sql.rowset) RowSet or CachedRowSet type behaviour than the standard ResultSet behaviour.

This could be due to needing to set something (in the API) to tell JConnect this way or you may not have installed the newer driver completely (there is a SQL script that needs to be applied and possible if you do that correctly it may change things).

But if this is an evolution of the product I would suggest you'll need to address this in your application's logic, possibly doing your own caching in the application instead of the driver.

HTH

Former Member
0 Kudos

Hey Nick thanks for your post.

So my understanding is by default it provides ResultSet behavior and hence we should be expecting result set to be closed when statement is closed, is this understanding correct?

Regards Varun