CRUD data
There are four kinds of SQL statements that read or manipulate data in a database:
- The
INSERT
statement adds data to a database. - The
SELECT
statement reads data from a database. - The
UPDATE
statement changes data in a database. - The
DELETE
statement deletes data from a 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 the statement with a certain execution path on the database server by...