ClientClob(ClobChunk firstChunk, ClientService service, HostConnection source) throws SQLException { super(service, firstChunk.last ? gfxdConstants.INVALID_ID : firstChunk.lobId, source); this.baseChunkSize = firstChunk.chunk.length(); this.currentChunk = firstChunk; if (firstChunk.isSetTotalLength()) { this.length = firstChunk.getTotalLength(); } else if (firstChunk.last) { this.length = this.baseChunkSize; } else { throw ThriftExceptionUtil.newSQLException( SQLState.BLOB_NONPOSITIVE_LENGTH, null, 0); } }
public Object getFieldValue(_Fields field) { switch (field) { case CHUNK: return getChunk(); case LAST: return Boolean.valueOf(isLast()); case LOB_ID: return Integer.valueOf(getLobId()); case OFFSET: return Long.valueOf(getOffset()); case TOTAL_LENGTH: return Long.valueOf(getTotalLength()); } throw new IllegalStateException(); }
final long totalLength = clob.getTotalLength(); if (totalLength <= 0) { throw ThriftExceptionUtil.newSQLException(