skip to Main Content

How can I use a variable outside while loop in java mysql

String xxx = "Select Totalpay from payments2 where committee_member = '"+memberName+"'"; pst = conn.prepareStatement(xxx); rs = pst.executeQuery(); while(rs.next()) { String totalPayment = rs.getString("TotalPay"); } table.addCell(cell); //String ttlpy = create(); table.addCell(totalPayment); I get the error at table.addCell(totalPayment): variable totalPayment may not…

VIEW QUESTION
Back To Top
Search