Daily summary: small details in preparedstatement (2021.11.28)

ExecuteUpdate in PreparedStatement ()

The brackets areDo not add parameters, such as SQL.

Here you must distinguish between the STATEMENT’s executeUpdate (), the latter is to add parameters, such as SQL;

 

This will then distinguish between Statement and PreparedStatement

Statement is used to perform a static SQL statement. When executed, you must specify a SQL statement that is in advance.

PRepareStatement is the precompiled SQL statement object, and the SQL statement is precompiled and saved in the object.The encapsulated SQL statement represents a certain type of operation, can include dynamic parameters “?” In the statement, can be “?” Dynamically set parameter values when executed.