This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JDBC and the fly likes isLast method for result set is not working Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "isLast method for result set is not working" Watch "isLast method for result set is not working" New topic
Author

isLast method for result set is not working

Shahnawaz Shakil
Ranch Hand

Joined: Aug 04, 2008
Posts: 57
Hi,
I am trying to retrieve data (Sybase database) from my web application something as below:


It seems that result.isLast() method is not working and throwing UnimplementedOperationException. Please suggest.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

You driver does not implement that method. To fix this you can hunt around for a suitable driver that does - I'm afraid I have no idea if one exists for Sybase - or you can change your logic to achieve what you want.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Shahnawaz Shakil
Ranch Hand

Joined: Aug 04, 2008
Posts: 57
Hi Paul,
I think you are right that it does not exist for sybase. Could you please suggest some logic because i need to come out of the loop once i reach the last row? I don't know how will i come to know if i have reached to the last row without using isLast method. Please help.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3670

Shahnawaz Shakil wrote:Could you please suggest some logic because i need to come out of the loop once i reach the last row?




Can you tell us what is the purpose of this loop? You need to get less than 5 records or what?

SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2343

know if i have reached to the last row
When rs.next() == false

We usually travel a resultset using this logic


OCUP UML fundamental
ITIL foundation
Shahnawaz Shakil
Ranch Hand

Joined: Aug 04, 2008
Posts: 57
Vijitha,
Yes i need to get latest five records or less. Reason for using this for loop.

Thanks Jan and Paul for your help. I have changed the logic and its working fine.

Thanks you all for your help and suggestions.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: isLast method for result set is not working
 
Similar Threads
Unexpected error when running application from tomcat.
dynamic method invocation
Ajax and Firefox
equals() and hashCode() methods
Help with sorting ArrayList using Comparator