java - Getting return value in JSP -
below code auto generate purchase order number mysql database in jsp. want return "pono" string shows error because outside if condition.
how can string return?
<%! public string autopono()throws sqlexception{ rs=pst.executequery(); if(rs.next()){ string po= rs.getstring("max(pono)"); int intno = integer.parseint(po); intno+=1; string pono = integer.tostring(intno); } return pono; } %>
declare variable otsido of loop:
<%! public string autopono()throws sqlexception{ string pono = null; rs=pst.executequery(); if(rs.next()){ string po= rs.getstring("max(pono)"); int intno = integer.parseint(po); intno+=1; pono = integer.tostring(intno); } return pono; } } %>
Comments
Post a Comment