开发者

Netbeans Java Storing ResultSet In Variable

开发者 https://www.devze.com 2023-03-28 08:02 出处:网络
I\'m using Netbeans and I want to store ResultSet results into an Integer variable, may I know if it is possible?

I'm using Netbeans and I want to store ResultSet results into an Integer variable, may I know if it is possible?

Currently I'm trying all sorts of ways to store it in a variable so I can use it for comparison on the JSP page itself.

            <%
    开发者_如何学C        int no=1;

            while(rst.next()){


            %>
            <tr>
              <td><%=no%></td>

                  <td><%=rst.getString("VERIFYCODE")%></td>

                  <%String code= request.getParameter("name"); %>

                  <%if(rst.getString("VERIFYCODE")== code){

                                  //return a true/false if possible, or redirect to another jsp page

                              }


If you want to get an Integer value from ResultSet, just use rst.getInt("VERIFYCODE") method or Integer.parseInt(rst.getString("VERIFYCODE")).

0

精彩评论

暂无评论...
验证码 换一张
取 消