There are four kinds of SQL statements that read or manipulate data in the database:
- The INSERT statement adds data to the database
- The SELECT statement reads data from the database
- The UPDATE statement changes data in the database
- The DELETE statement deletes data from the database
Either one or several different clauses can be added to the preceding statements to identify the data that is requested (such as the WHERE clause) and the order in which the results have to be returned (such as the ORDER clause).
The JDBC connection is represented by java.sql.Connection. This, among others, has the methods required to create three types of objects that allow you to execute SQL statements that provide different functionality to the database side:
- java.sql.Statement: This simply sends the statement to the database server for execution
- java.sql.PreparedStatement: This caches...