Prepare-and-execute

In the prepare-and-execute method, the client application sends the server a sequence of server commands that prepares a statement, and executes it one or more times. The application can send additional commands to query the server for the formats of the statements’ input parameters and the result set it returns.

Prepare-and-execute is used for commands that are usually executed multiple times, perhaps with different parameters each time. It can involve fetchable data as well as cursors. It uses a unique identifier that must be preserved during a failover.