SQLPreparedStatement
SQL prepared statement
Description
The SQLPreparedStatement object enables you to create an SQL
prepared statement. An SQL prepared statement can import, update, insert, or delete data in a
database. Also, an SQL prepared statement can call stored procedures in a
database.
The SQL statement can be one of these statements:
SELECTINSERTUPDATEDELETECALL
An SQL prepared statement contains parameters that are bound to values. By binding the parameters, you can execute the same SQL statement for different values repeatedly. The benefits of using SQL prepared statements include improved performance and security.
Note
If you use SQL prepared statements with a JDBC driver and a database other than Microsoft® SQL Server® or PostgreSQL, the behavior of the SQL prepared statement varies based on the JDBC driver implementation of the statement. The behavior can cause unexpected results.
Creation
Create an SQLPreparedStatement object with the databasePreparedStatement function.
Properties
Object Functions
bindParamValues | Bind values to parameters |
close | Close SQL prepared statement |
Examples
Limitations
The
SQLPreparedStatementobject supports a JDBC database connection only.
Version History
Introduced in R2019b