我在ResultSet rs = Statement.executeQuery("SELECT * FROM patient");
代码行的执行查询部分出错。我不知道出了什么问题。希望得到帮助。
JButton btnDb1 = new JButton("J");
btnDb1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
try {
ResultSet rs = Statement.executeQuery("SELECT * FROM patienttable");
while (rs.next()) {
Patient patient = new Patient(rs.getString("patientname"), rs.getString("patientaddress"), rs.getString("patientphone"), rs.getInt("patientid"));
}
} catch (Exception e) {
System.out.println(" Error ");
}
}
});
btnDb1.setBounds(200, 393, 120, 23);
contentPane.add(btnDb1);