On 02 Jul 2013 18:33, James H. H. Lampert wrote:

So far as I have been able to determine, there IS NO TOOL in JDBC
for randomly jumping to a key value within a result set, nor for
scrolling outside of a result set!

My understanding is that if I open a result set starting at a
specified key value, somewhere in the middle of a file, JDBC has no
way of jumping to a record that's some specified number of records
before the beginning of that result set, and likewise, if I open a
result set of the entire file, JDBC has no way of jumping to a
specific key value within the result set.

If I'm mistaken on this, somebody please tell me.

The goal here is not to re-implement native RLA for DB2/400 (that
would be the most profound waste of time in history); it's to get
RLA-like access to other databases.

I suppose an effective binary search using positioning within a ResultSet ordered by the effective key could accomplish something like what is the described as-desired effect.?

http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/topic/rzaha/rsltcurs.htm
IBM i 7.1 Information Center -> Programming -> Java -> IBM Developer Kit for Java -> Database access from Java programs -> Accessing your IBM i database with the Java JDBC driver -> ResultSets
_i Cursor movement i_
"The IBM® i Java Database Connectivity (JDBC) drivers support scrollable ResultSets. With a scrollable ResultSet, you can process rows of data in any order using a number of cursor-positioning methods.

The ResultSet.next method is used to move through a ResultSet one row at a time. With Java Database Connectivity (JDBC) 2.0, the IBM i JDBC drivers support scrollable ResultSets. Scrollable ResultSets allow processing the rows of data in any order by using the previous, absolute, relative, first, and last methods.

By default, JDBC ResultSets are always forward only, meaning that the only valid cursor-positioning method to call is next(). You have to explicitly request a scrollable ResultSet. ...
..."


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.