I'm using java netbeans & mysql and i used "insert into select statement".
But when I run the program and input the data it always says "Column count doesn't match the value count at row 1"
Connection conn = null;
ResultSet rs = null;
PreparedStatement pst = null;
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {
String sql = "insert into tbl_addcharityroom1 values ('"+ jTextField10aw.getText() +"', (select charityWardID from tbl_addcharityward where diseaseCategory='"+ jComboBox1.getSelectedItem().toString() +"'))";
try {
pst = conn.prepareStatement(sql);
JOptionPane.showMessageDialog(null, "Saved");
pst.execute();
}
catch(Exception e){
JOptionPane.showMessageDialog(null, e);
}
}