jQuery in Action, 2nd edition*
The moose likes JDBC and the fly likes resultset doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "resultset doubt" Watch "resultset doubt" New topic
Author

resultset doubt

Janardan Kelkar
Ranch Hand

Joined: May 05, 2008
Posts: 72



the above code gives me an error as shown:
"Invalid cursor state"

what is the default data type of results of an aggregate functions?!


When the compiler's not happy, ain't nobody happy.
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2497
    
    8

you should call .... rs.next() ....


OCUP UML fundamental and ITIL foundation
youtube channel
Janardan Kelkar
Ranch Hand

Joined: May 05, 2008
Posts: 72

thank you....how could i do that!!
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30402
    
150

Originally posted by Janardan Kelkar:
thank you....how could i do that!!




Note that normally you would have rs.next() is a while loop. count() is a special function that is guaranteed to always return one row (and one column) even if no rows match.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: resultset doubt