1 Reply Latest reply on Oct 16, 2001 1:56 AM by Michael Magnaye

    Getting an int from resultset to use throughout jsp

    Graham Newbie

      Hi, I create a resultset which has only 1 result(int)
      try
      {
      //Get connection
      String sql="SELECT MAX(numberField) from table";
      stmt=con.createStatement();
      rs=stmt.executeQuery(sql);
      while(rs.next())
      {
      int highNum=rs.getInt(1);
      }
      rs.close;
      rs=null;
      stmt.close();
      stmt=null;
      }
      finally
      {
      if(con!=null)
      {con.close();
      }
      }
      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.
      THANKS!!