Nonstop Database, HiRDB Version 9 UAP Development Guide
Sets the maximum data size for retrieval of data of the LONGVARBINARY type (a JDBC SQL type).
public void setMaxBinarySize ( int size ) throws SQLException
None.
Sets the maximum data size (bytes) when data of the LONGVARBINARY JDBC SQL type is retrieved.
When the JDBC driver retrieves LONGVARBINARY data, it allocates memory of the defined length because it cannot recognize the actual data length until it retrieves the data. Consequently, if the JDBC driver retrieves values from a column that is very large, such as 2,147,483,647 bytes (the maximum size for HiRDB's BINARY and BLOB data types), it attempts to allocate memory space of the defined length (2,147,483,647 bytes) as the defined length. Depending on the execution environment, this may cause a memory shortage.
You should use this method to specify the maximum length of the data that is actually stored. If the defined length of the BINARY and BLOB data to be retrieved is larger than the size specified by this method, the JDBC driver truncates the retrieved data to the specified size. When data has been truncated, the JDBC driver receives a warning from the HiRDB server when the next method of ResultSet is executed. The JDBC driver responds to the received warning by throwing an SQLException or issuing (or ignoring) an SQLWarning, as specified by the setLONGVARBINARY_TruncError value.
If a maximum data size has not been set by this method, the defined length of the data to be retrieved is used as the maximum data size.
If a negative value is specified, this method throws an SQLException.
Any value specified for this method is not effective when LOCATOR is specified in the mode argument of the setLONGVARBINARY_Access method. In such a case, the JDBC driver allocates an area based on the actual data length and retrieves all of the data.
All Rights Reserved. Copyright (C) 2011, Hitachi, Ltd.