public void setCharacterStream(OptimizedElementArray row, int columnPosition, Reader reader, long length, LobService lobService) throws SQLException { if (length <= Integer.MAX_VALUE) { setClob(row, columnPosition, lobService.createClob(reader, length)); } else { throw ThriftExceptionUtil.newSQLException( SQLState.BLOB_TOO_LARGE_FOR_CLIENT, null, length, Integer.MAX_VALUE); } }
@Override public void setClob(OptimizedElementArray row, int columnPosition, Clob x) throws SQLException { if (x != null) { // mark as non-null and call the underlying type's method getConverterForSet(row.setNotNull(columnPosition - 1), "clob", columnPosition).setClob(row, columnPosition, x); } }
public void setAsciiStream(OptimizedElementArray row, int columnPosition, InputStream stream, long length, LobService lobService) throws SQLException { if (length <= Integer.MAX_VALUE) { setClob(row, columnPosition, lobService.createClob(stream, length)); } else { throw ThriftExceptionUtil.newSQLException( SQLState.BLOB_TOO_LARGE_FOR_CLIENT, null, length, Integer.MAX_VALUE); } }
/** * {@inheritDoc} */ @Override public final void setClob(int parameterIndex, Clob x) throws SQLException { checkValidParameterIndex(parameterIndex); Converters.getConverter(getType(parameterIndex), "clob", true, parameterIndex).setClob(this.paramsList, parameterIndex, x); }
/** * {@inheritDoc} */ @Override public final void updateClob(int columnIndex, Clob x) throws SQLException { final Row currentRow = checkValidColumn(columnIndex); initRowUpdate("updateClob"); if (x != null) { ColumnValueConverter cvc = Converters.getConverter( getSnappyType(columnIndex, currentRow), "clob", true, columnIndex); cvc.setClob(currentRow, columnIndex, x); } else { currentRow.setNull(columnIndex - 1); } this.changedColumns.set(columnIndex - 1); }