Here trying to display the entire row from database in textArea / jTextField or jTable chosen by jComboBox or any choice box from a database column.
Can't find suitable methods like addtext
+ ResultSet
: IDE keeps telling me that ResultSet
can't be converted to string.
Thus like to set synchronized box and textfield, the tryouts only started together then lost synchronization.
Current situation:
try {
String sql="select * from employees";
pst=conn.prepareStatement(sql);
rs=pst.executeQuery();
while(rs.next()) {
String first =rs.getString("first");
jComboBox1.addItem(first);
String itemtext = (String)jComboBox1.getSelectedItem();
jTextField1.setText(itemtext);
}