943,754 Members | Top Members by Rank

Ad:
  • JSP Discussion Thread
  • Unsolved
  • Views: 1392
  • JSP RSS
Feb 22nd, 2008
0

Accessing record by row number

Expand Post »
In a JSP how do I access a record by its number?
Reputation Points: 10
Solved Threads: 0
Light Poster
eddy556 is offline Offline
32 posts
since Jan 2008
Feb 22nd, 2008
0

Re: Accessing record by row number

Which record are you talking about anyways? Please make an attempt to at least specify the exact nature of your problem as explicitly as possible instead of letting the one helping you out to do all the thinking.
Super Moderator
Featured Poster
Reputation Points: 3233
Solved Threads: 719
Failure as a human
~s.o.s~ is offline Offline
8,871 posts
since Jun 2006
Feb 22nd, 2008
0

Re: Accessing record by row number

Sorry. I have a JSP which accesses an Access database and prints its records to screen. What I want to be able to do is to access the records and print them by there row number in the record set. Something along the lines of:

rs.Record[1]
rs.Record[2]
rs.Record[3]

..and so on.

Thanks for your help
Reputation Points: 10
Solved Threads: 0
Light Poster
eddy556 is offline Offline
32 posts
since Jan 2008
Feb 25th, 2008
0

Re: Accessing record by row number

You can only use data that is in the table. All other data is artificial. You could use a for loop (or something like a <c:forEach> with an incremental variable) the numbers though are not tied to each record. I.E. record 0 is only ever the first record you retrieve not the primary key or an identifier of the data.

You won't be able to use this to update records etc.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dogma is offline Offline
14 posts
since Aug 2003
Feb 25th, 2008
0

Re: Accessing record by row number

Also:
Are you using JSP tags or reverting back to java?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dogma is offline Offline
14 posts
since Aug 2003

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JSP Forum Timeline: automatic number generation and incrementation..
Next Thread in JSP Forum Timeline: How to save a word document accepted from user in MS SQL?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC