Hi, I create a resultset which has only 1 result(int)
- Posted by: Graham Forte
- Posted on: October 12 2001 15:09 EDT
String sql="SELECT MAX(numberField) from table";
this works fine, the problem is I need this value(highNum) throughout the jsp, how?, as now it is only available within the while(rs.next)block.
- Getting a ResultSet value from resultset to use throughout jsp by Gregory Bragg on October 12 2001 16:03 EDT
Scope is the problem... you are creating and intializing the int value inside of the brackets of the while loop and it won't be accessible to anything outside of the brackets.
Try this instead:
int highNum = 0;
That'll solve your problem...