【发布时间】:2015-05-25 15:07:56
【问题描述】:
这是我的按钮
btnSil.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
String sorgu="DELETE FROM muhasebe Where MuhasebeAdi='?', MuhasebeSoyadi='?', kul_adi='?' ,sifre='?' ";
DBConnection.KullaniciSil(muhasebe_ad.getText(), muhasebe_soyad.getText(), muhasebe_kul_adi.getText(), muhasebe_sifre.getText(), sorgu);
}
}
这是我的连接,我认为有问题,但我没有找到
public static void KullaniciSil(String ad, String soyad, String kadi, String sifre,String sorgu1){
connection();
try
{
Connection connect = DriverManager.getConnection(host, username , pass);
PreparedStatement statement = (PreparedStatement) connect.prepareStatement(sorgu1);
statement.setString(1, ad);
statement.setString(2, soyad);
statement.setString(3, kadi);
statement.setString(4, sifre);
statement.executeUpdate();
statement.close();
connect.close();
}
catch(SQLException e)
{
e.printStackTrace();
}
}
【问题讨论】: