DYNAMIC_PREPARE Connection Property

DYNAMIC_PREPARE is a Boolean-valued connection property for enabling dynamic SQL prepared statements.

In this example, DYNAMIC_PREPARE is false to disable precompilation of dynamic SQL statements, and props is a Properties object for specifying connection properties.
...
props.put("DYNAMIC_PREPARE", "false")
Connection conn = DriverManager.getConnection(url, props);
When DYNAMIC_PREPARE is true:

As a general rule, explicitly close every PreparedStatement object after its last use to prevent prepared statements from accumulating in server memory during a session and slowing performance.