JDBC Statements

What is a Statement We have established a connection with a database in the previous topic, and now we are ready to add records to the database tables and retrieve results from them. To perform actions on a database, we need to use SQL statements. An interface java.sql.Statement represents such statements in the JDBC API.

JDBC Prepared Statements

What is a Prepared Statement? We have already observed JDBC statements and how to use them to interact with the database. However, as you could’ve noticed, the JDBC Statement interface is not so flexible. Since you have to specify each statement as a string, there is no way to set statement parameters such as a record id or a column value. Another disadvantage of the Statement interface is that…