Code example for Clob

Methods: length

0
	 * 
	 * @throws SQLException 
	 */ 
	private static long determineLengthForBufferSizing(Clob value) throws SQLException {
		try { 
			return value.length();
		} 
		catch ( SQLFeatureNotSupportedException e ) {
			return BUFFER_SIZE;
		} 
	} 
 
	/** 
	 * Make sure we allocate a buffer sized not bigger than 2048, 
	 * not higher than what is actually needed, and at least one. 
	 *  
	 * @param lengthHint the expected size of the full value 
	 * @return the buffer size 
	 */ 
	private static int getSuggestedBufferSize(final int lengthHint) {
		return Math.max( 1, Math.min( lengthHint , BUFFER_SIZE ) );