My current company already have a framework in place and in their framework they have a class that handles all the database connectivity (including pooling) and statement preparation/executions.
Tried doing some scrolling on the returned resultset but ended up with an exception. With some checking, I noticed that the returned resultset is nonscrollable. Looking at the framework code, seems like it is using the prepareStatement(String sql) method without the facility to include or provide the resultSetType and the resultSetConcurrency. I could have easily fixed this problem by extending the class and overriding/overloading methods to create a scrollable resultset. But the attributes and methods that I need to do so are all private and so will not be visible and accessible from the child class. Already asked them if I can update their framework directly to expose a new method that also accepts resultSetType and resultSetConcurrency but they are still a bit hesitant about it considering that there are already dozens of applications built on top of it.
Is there a way I can transform/clone a resultset to become scrollable? Or to set the current preparedstatement to scrollable prior to executing it? Any form of help you can provide will be very much appreciated.
Originally posted by jay ceebee: Is there a way I can transform/clone a resultset to become scrollable? Or to set the current preparedstatement to scrollable prior to executing it? Any form of help you can provide will be very much appreciated.
No. By the time you get the resultset, it's type is already set. And a Statement requires to know the type at creation type.
Ask the framework team if they can add a new method. I can understand the need to make things backward compatible, but that doesn't prohibit additions to the API.
Another thing is to consider why you need the resultset to be scrollable. Often things that hint at a scrollable resultset can be done in another (sometimes cleaner) way.