× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Rick,

You're actually pretty close, though I'm a bit hazy on the backward
and forward stuff. You should be able to have as many separate
read/write commands as you need to appropriately accomplish your task.
How you handle the connections has a lot to do with efficiencies.
You can share a connection across several read/write commands, and
iterate through result sets as you need them. I tend to think of
these things as big loops. You could imagine code looking something
like this....

while (readCommandA.next())
{
if(some condition dealing with data from row in readCommandA)
{
while (readCommandB.next())
{
updateCommand1.execute();
}
}
}

It might be a good idea however, to see if with SQL you can get at all
of the data you want to make decisions in one result set so that you
can cut down on database hits. If you choose to use
PreparedStatements for your read commands and want to run them in
loops, it's also a good idea to close the ResultSet (if you're done
with it) before you reset the parameters and run the query again.

I don't know if this helps, but those are some thoughts.
Joe

On 8/29/07, MidRange <R_C_DUVALL@xxxxxxxxxx> wrote:
Hi Group,

I am working on an application using jt400 jdbc to access a db on
the i5. The application moves backward and forward through a couple
of files (in lockstep) randomly, based on user input. What is the
best way to accomplish this? I can just create a statement and
result set with each iteration, but it seems there ought to be a way
to use a cursor or something to traverse the tables more
economically without opening and closing result sets constantly.
However, I cannot find anything that allows me to do that. I am
only an egg.;) Can someone enlighten me? Thanks!

--
Best regards,
Rick

Systems Manager
Dealer's Auto Auction of Okc
1028 S. Portland
Oklahoma City, OK 73108
(405) 947-2886
mailto:rick@xxxxxxxxxx
http://www.nothingisreal.com/dfki/no-word

--
This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.



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-2024 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.