on-internet
← Community

Select Query and will appear to comboBox in Netbeans & mysql

Stack Overflow ·

I got problem on this code: String charitysql = "SELECT wardName, charityRoomID FROM tbl_charityward,tbl_charityroom2 WHERE tbl_charityward.charityWardID = tbl_charityroom2.charityWardID"; try { pst = conn.prepareStatement(charitysql); rs = pst.executeQuery(); while (rs.next()) { String wardname = rs.getString("wardName"); cb_ward2.addItem(wardname); String roomid = rs.getString("charityRoomID"); cb_room2.addItem(roomid); } } catch(Exception e) { JOptionPane.showMessageDialog(null, e); } this is my tables structure: tbl_charityward charityWardID int NOT NULL AUTO_INCREMENT, wardName varchar(20

Comments

Sign in or sign up to comment and upvote.

No comments yet.