Statement caching improves performance by caching repeatedly used executable statements, such as statements in loops or in repeatedly called methods.
The Java Database Connectivity (JDBC) standard defines a statement caching interface.
Statement caching serves to:
Save the overheads for repeatedly creating cursors.
Prevent repeated statement parsing and creation.
Reuse data structures in clients.
Explicit statement caching can cache and retrieve specified prepared and callable statements. Explicit statement caching is dependent on a key, which is a Java String provided.
Explicit statement caching retains the statement data, status, and metadata, thus providing high performance. During explicit statement caching, if OceanBase Connector/J fails to find a matching statement in the cache, null is returned.