java - trying to reuse a ResultSet obtained from database -
driver dr = new driver(); myconn = dr.connectdb(); mystmt = myconn.preparecall("{call spviewusers()}"); mystmt.execute(); myrs = mystmt.getresultset(); while (myrs.next()){ string name = myrs.getstring("userid"); cbuser.additem(name); }
this simple login window username populated jcombobox (cbuser). code above works, i'm wondering if can re-use resultset obtain corresponding password when cbuser value changed, or have store resultset fields array. it'd nice if specific row based on value of column (not column's label). example, let's table:
userid userpassword ------------------- admin 123456 guest qwerty random abcd
i want value "qwerty" when "guest" selected in cbuser. possible? thanks!
Comments
Post a Comment