How to compare a value which is taken from JTextField with the database value???

i just want to compare those two values and if the data exists in it.. i just want to delete from the database

---> i just want to compare those two values and if the data exists in it.. i just want to delete from the database

   Get the values from the textfield & pass into the select query. If the resultset is available, write the delete query to delete the particular record.****

ya i wil get the value from text field and i vl delete.. for example
a=B.getText();
executeUpdate("select * from table where name="+a+";");
can we write a query like this??