1

this is my button

 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);
        }
    }

and this is my connection and i think problems THERE but i dont find

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();

}

}

1 Answer 1

1

You should unquote all the place holders (?) and add conditions to your WHERE clause :

String sorgu="DELETE FROM muhasebe Where MuhasebeAdi=? AND MuhasebeSoyadi=? AND kul_adi=?  AND sifre=?";
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.