jQuery in Action, 3rd edition
The moose likes JDBC and Relational Databases and the fly likes Sql Result set processing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Sql Result set processing" Watch "Sql Result set processing" New topic

Sql Result set processing

Steve Sutton

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

Joined: Jan 10, 2002
Posts: 63865

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.

[Asking smart questions] [About Bear] [Books by Bear]
Wayne L Johnson
Ranch Hand

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

and not something like:
Dirk Schreckmann

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

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

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://aspose.com/file-tools
subject: Sql Result set processing
It's not a secret anymore!