This document demonstrates how to use a prepared statement and ResultSet interface to delete a record from a database table. It imports the necessary Java SQL classes, loads the JDBC driver, gets a connection to the "stud" database, creates a prepared statement to delete from the student table where the roll number equals a set integer (27), executes the delete, commits the transaction, and closes the connection. The output confirms the record was deleted successfully.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
338 views
AJP PR 19
This document demonstrates how to use a prepared statement and ResultSet interface to delete a record from a database table. It imports the necessary Java SQL classes, loads the JDBC driver, gets a connection to the "stud" database, creates a prepared statement to delete from the student table where the roll number equals a set integer (27), executes the delete, commits the transaction, and closes the connection. The output confirms the record was deleted successfully.