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"))
.
精彩评论