[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 362
  • Last Modified:

moving record in resultset

Hi all,
I want to show data in my table then move record to first, next, previous, last. How can I do that?

Thanks.
0
sdieken
Asked:
sdieken
  • 2
1 Solution
 
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
http://javaalmanac.com/egs/java.sql/pkg.html

check out the above it has with examples of various things you can do on database using java with examples.

check out reteriving data session in particular that will solve your task.

http://www.java2s.com/Code/Java/Database-SQL-JDBC/CatalogDatabase-SQL-JDBC.htm

here is one more good site with working examples.

Thank You.
0
 
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
>>then move record to first, next, previous, last

what you meant by that is to show those records or to actually move there position in the result set? or table?
0
 
Manikandan ThiagarajanSenior consultantCommented:
0
 
colr__Commented:
To move about the resultset object:

ResultSet rs = ...;

rs.first(); // move to first
rs.next(); // move to next (returns boolean wether there is a next or not)
rs.last(); // move to last
rs.getRow(); // get the current row number

There isnt a 'previous' method as far as Im aware - youd need to strat at the first and cylce through them all until you get to the end.

colr__
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now