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 Sql Result set processing 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 "Sql Result set processing" Watch "Sql Result set processing" New topic
Author

Sql Result set processing

Steve Sutton
Greenhorn

Joined: Aug 06, 2003
Posts: 7
I am using an SQL call to db2 to get the count(*) value from a query. I was going to use the getInt method to get the value of the count. I cannot use that method. I get the following error: The method getInt(int) from the type resultset is not static. What method should I use to get the value of the result? Since I am not returning a column value, I am unsure of what to use.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56185
    
  13

We'll need to see your code, particularly in the area around the getInt() call (please be sure to use the UBB code tags).
It looks like you are using getInt() in a static context, and it most certainly is not a static method.
hth,
bear


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Wayne L Johnson
Ranch Hand

Joined: Sep 03, 2003
Posts: 399
Make sure you are doing:

and not something like:
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Moving this to the JDBC forum...


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Steve Sutton
Greenhorn

Joined: Aug 06, 2003
Posts: 7
Wayne, Thank you for helping out. I was doing it the way you said not to do it. Changed the code, works great! Thanks again.
 
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: Sql Result set processing
 
Similar Threads
How to get no of Rows ?
No Printer Found
Using ResultSet.getString( )
Number of rows in a table?
a basic question