LOB Streaming

The term large object (LOB) refers to a data item that is too large to be stored directly in a database table. Instead of the data, a locator is stored in the database table which points to the location of the data. Using LOBs keeps rows and their tables smaller, allowing for better caching and faster data transfer. LOBs are not fetched with their row unless explicitly referenced. LOB streaming (BLOB and CLOB) is enabled by default in the NuoDB JDBC driver.

When a query fetches a BLOB or CLOB column, the NuoDB JDBC driver transfers the data to the client. This data can be accessed as a stream using ResultSet.getCharacterStream() or ResultSet.getBinaryStream() methods. ResultSet.getBlob() and ResultSet.getClob() will read the BLOB or CLOB from the TE into a memory buffer and wrap that buffer. The blob can read in chunks, as specified by the lobChunkSize connection property. The default chunk size is 65536 bytes.

The two connection properties that control LOB streaming are lobChunkingEnabled and lobChunkSize. For more information, see Connection Properties.

LOB uploading in chunks (setBlob() and setClob()) is not currently supported.