PrepareThreshold
- Last Updated: February 14, 2022
- 1 minute read
- DataDirect Connectors
- JDBC
- PostgreSQL 6.0
- Documentation
Purpose
Specifies the number of PreparedStatement executions that must occur before the driver begins using server-side prepared statements.
Valid Values
0 | 1 | x
where:
- x
- is a positive integer that represents the number of PreparedStatement executions at which the driver begins using server-side prepared statements.
Behavior
If set to 0, the driver never uses
server-side prepared statements.
If set to 1, the driver uses server-side
prepared statements by default.
If set to x, the driver uses server-side prepared statements when the number of PreparedStatement executions reaches the specified value.
Example
If PrepareThreshold is set to 5, the
driver starts using server-side prepared statements on the fifth execution of the same
PreparedStatement object.
Note
- This property is applicable when the EnablePrepareThreshold property is
set to
true. - The value
0is recommended when using a load balancer with a server that cannot support server-side prepare operations. - The value
1is recommended when an application executes the same parameterized DML operation multiple times. - The value x is recommended when the server-side prepare operation is used only for frequently executing queries.
Data Source Methods
public Integer getPrepareThreshold()
public void
setPrepareThreshold(Integer)
Default
1
Data Type
int