this is code for delete button,is there any errors??,plz help guys
try {
Class.forName("com.mysql.jdbc.Driver");
Connection cc = (Connection) DriverManager.getConnection("jdbc:mysql://localhost/registration", "root", "");
Statement s = (Statement) cc.createStatement();
ResultSet r = s.executeQuery("delete from students where nic=" + nic.getText() + "");
while (r.next()) {
name.setText(r.getString("Name"));
phone.setText(r.getString("Phone"));
email.setText(r.getString("Email"));
course.setSelectedItem(r.getString("Course"));
}
} catch (Exception e) {
e.printStackTrace();
}
Re: this is code for delete button,is there any errors??,plz help guys
Please Edit your post and wrap your code with
[code=java]
<YOUR CODE HERE>
[/code]
to get highlighting and preserve formatting.
Can you explain your problem? The code that was posted can't be compiled or executed for testing.