jQuery in Action, 3rd edition
The moose likes JDBC and Relational Databases 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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "resultset doubt" Watch "resultset doubt" New topic

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

Joined: Dec 20, 2006
Posts: 2551

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

OCUP UML fundamental and ITIL foundation
Janardan Kelkar
Ranch Hand

Joined: May 05, 2008
Posts: 72

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

Joined: May 26, 2003
Posts: 32633

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.

[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
I agree. Here's the link: http://aspose.com/file-tools
subject: resultset doubt
It's not a secret anymore!