Hello,
I would like to retieve data into my combobox.
I have done this so far but when I click on the button it's not giving me anything:
public void displayItem(int data1) {
String sql = ("select * from Students limit ?,1");
try {
st = (PreparedStatement) con.prepareStatement(sql);
st.setInt(1, data1);
st.executeQuery();
rs = st.getResultSet();
while (rs.next()) {
String s = rs.getString("Nationality");
cb1.addItem(s.trim());
//cb1.addItem(rs.getString("Nationality"));
cb2.addItem(rs.getString("Duration"));
cb3.addItem(rs.getString("Price"));
cb4.addItem(rs.getString("Frequency"));
cb5.addItem(rs.getString("Time"));
cb6.addItem(rs.getString("Stage"));
cb7.addItem(rs.getString("Teacher"));
}
} catch (Exception e) {
}
}