In Oracle mode, OceanBase Connector/J sends streaming data by using the COM_STMT_SEND_PIECE_DATA protocol. This topic describes the COM_STMT_SEND_PIECE_DATA and COM_STMT_GET_PIECE_DATA protocols.
Supported data types
COM_STMT_SEND_PIECE_DATA supports piecewise extraction, insertion, and update of data of the following types:
VARCHAR2
STRING
LONG
LONGRAW
RAW
CLOB
BLOB
Optional URL parameters
The following table lists the URL parameters supported by the piecewise sending feature for streaming data.
| Parameter | Default value | Description |
|---|---|---|
| usePieceData | False | This parameter takes effect only when useServerPrepStmts=true in Oracle mode, that is, when usePieceData=true and useServerPrepStmts=true. This parameter is disabled by default. |
| pieceDataSize | 1024 | The maximum size of data that can be sent in each piece. This parameter cannot be modified. |
COM_STMT_SEND_PIECE_DATA protocol
The protocol number of COM_STMT_SEND_PIECE_DATA is 0xa2. The packet content is as follows:
COM_STMT_SEND_PIECE_DATA
direction: client -> server
response: none
payload:
1 [a2] COM_STMT_SEND_PIECE_DATA
4 statement-id
2 param-id //Starting from 1
1 piece-type
8 data-len
n data
COM_STMT_GET_PIECE_DATA protocol
The protocol number of COM_STMT_GET_PIECE_DATA is 0xa3. This protocol can be used only when the configuration useOraclePrepareExecute=true is used. The packet content is as follows:
COM_STMT_GET_PIECE_DATA_RESPONSE
direction: server->client
response: none
payload:
1 piece_type (1) -- piece type: OCI_FIRST_PIECE/OCI_NEXT_PIECE/OCI_LAST_PIECE
8 data-len
n data