File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 2477
    
    7

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: 29249
    
139

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
 
Similar Threads
doubt about '?' symbol
JavaScript Newbie Simple Problem
Regular expression for valid xml
the Exclusive OR operator
Please explain the output of this: This question is from ExamLabs Diagnostic Test