PrepareMethod
- Last Updated: May 15, 2020
- 1 minute read
- DataDirect Connectors
- JDBC
- IBM Db2 5.1
- MySQL 5.1
- Progress OpenEdge 5.1
- SAP Sybase 5.1
- Documentation
Purpose
Determines whether stored procedures are created on the server for prepared statements.
Valid Values
StoredProc | StoredProclfParam |
Direct
Behavior
If set to StoredProc, a stored procedure is created when the statement is
prepared and is executed when the prepared statement is executed.
If set to StoredProcIfParam, a stored procedure is created only if the
prepared statement contains one or multiple parameter markers. In this case, it is created
when the statement is prepared and is executed when the prepared statement is executed. If
the statement does not contain parameter markers, a stored procedure is not created and the
statement is executed directly.
If set to Direct, a stored procedure is not created for the prepared
statement and the statement is executed directly. A stored procedure may be created if
parameter metadata is requested.
Setting this property to StoredProc or StoredProclfParam
can improve performance if your application executes prepared statements multiple times
because, once created, executing a stored procedure is faster than executing a single SQL
statement. If a prepared statement is only executed once or is never executed, performance
can decrease because creating a stored procedure incurs more overhead on the server than
simply executing a single SQL statement. Setting this property to Direct
should be used if your application does not execute prepared statements multiple times.
Default
StoredProcIfParam
Data Type
String