This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes problem with isLast()! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "problem with isLast()!" Watch "problem with isLast()!" New topic

problem with isLast()!

Brian Smith
Ranch Hand

Joined: Oct 26, 2002
Posts: 232
hi folks,
here are my codes snippets;

i don't get it why the use of rs.isLast() throws exception. is it wrong to use this way? Please help me with this.
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
Throws what exception?
Also, do you realize that with your calls, you are skipping every other record?

Ron Newman - SCJP 1.2 (100%, 7 August 2002)
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33132

Not all database drivers support rs.isLast()

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Brian Smith
Ranch Hand

Joined: Oct 26, 2002
Posts: 232
i have codes like this:

After i reach the last record and click the next button again, it throws the following exception:[Microsoft][ODBC Driver Manager] Invalid cursor state
what i want to do is check if this is the last record. if this is the last record, display a message that this is the last record otherwise keep displaying the next record.
how do i implement this idea? please help me with this.
I agree. Here's the link:
subject: problem with isLast()!
It's not a secret anymore!