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, a locator is stored in the database table, which points to the location of the actual data. This can refer to the SQL type BLOB or CLOB. 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. LOB streams are chunked, by default, in 65536 byte chunks. This can be overwritten by the lobChunkSize connection property.

There are two connection properties that control LOB streaming. They are:

Property Default Description

lobChunkingEnabled

true

If set to true, LOB streaming is enabled.

lobChunkSize

65536

Overrides the default maximum chunk size for LOB streaming.

ResultSet.getBlob() and ResultSet.getClob() will read the BLOB or CLOB in lobChunkSize sized chunks from server into memory buffer and wrap that buffer.

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