• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sql Result set processing

 
Steve Sutton
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65126
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Wayne L Johnson
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure you are doing:

and not something like:
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the JDBC forum...
 
Steve Sutton
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic