@Override public void setAsciiStream(OptimizedElementArray row, int columnPosition, InputStream stream, long length, LobService lobService) throws SQLException { if (stream != null) { // mark as non-null and call the underlying type's method getConverterForSet(row.setNotNull(columnPosition - 1), "AsciiStream", columnPosition).setAsciiStream(row, columnPosition, stream, length, lobService); } }
@Override public void setBigDecimal(OptimizedElementArray row, int columnPosition, BigDecimal x) throws SQLException { if (x != null) { // mark as non-null and call the underlying type's method getConverterForSet(row.setNotNull(columnPosition - 1), "BigDecimal", columnPosition).setBigDecimal(row, columnPosition, x); } }
@Override public void setBinaryStream(OptimizedElementArray row, int columnPosition, InputStream stream, long length, LobService lobService) throws SQLException { if (stream != null) { // mark as non-null and call the underlying type's method getConverterForSet(row.setNotNull(columnPosition - 1), "BinaryStream", columnPosition).setBinaryStream(row, columnPosition, stream, length, lobService); } }
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); } }
public void setBinaryStream(OptimizedElementArray row, int columnPosition, InputStream stream, long length, LobService lobService) throws SQLException { if (length <= Integer.MAX_VALUE) { setBlob(row, columnPosition, lobService.createBlob(stream, length)); } else { throw ThriftExceptionUtil.newSQLException( SQLState.BLOB_TOO_LARGE_FOR_CLIENT, null, length, Integer.MAX_VALUE); } }
@Override public void setBytes(OptimizedElementArray row, int columnPosition, byte[] x) throws SQLException { if (x != null) { // mark as non-null and call the underlying type's method getConverterForSet(row.setNotNull(columnPosition - 1), "byte[]", columnPosition).setBytes(row, columnPosition, x); } }
@Override public void setBoolean(OptimizedElementArray row, int columnPosition, boolean x) throws SQLException { // mark as non-null and call the underlying type's method getConverterForSet(row.setNotNull(columnPosition - 1), "boolean", columnPosition).setBoolean(row, columnPosition, x); }
@Override public void setCharacterStream(OptimizedElementArray row, int columnPosition, Reader reader, long length, LobService lobService) throws SQLException { if (reader != null) { // mark as non-null and call the underlying type's method getConverterForSet(row.setNotNull(columnPosition - 1), "CharacterStream", columnPosition).setCharacterStream(row, columnPosition, reader, length, lobService); } }
@Override public void setByte(OptimizedElementArray row, int columnPosition, byte x) throws SQLException { // mark as non-null and call the underlying type's method getConverterForSet(row.setNotNull(columnPosition - 1), "byte", columnPosition).setByte(row, columnPosition, x); }
@Override public void setDate(OptimizedElementArray row, int columnPosition, Date x) throws SQLException { if (x != null) { // mark as non-null and call the underlying type's method getConverterForSet(row.setNotNull(columnPosition - 1), "date", columnPosition).setDate(row, columnPosition, x); } }
@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); } }
@Override public void setBlob(OptimizedElementArray row, int columnPosition, Blob x) throws SQLException { if (x != null) { // mark as non-null and call the underlying type's method getConverterForSet(row.setNotNull(columnPosition - 1), "blob", columnPosition).setBlob(row, columnPosition, x); } }
public void setBlob(OptimizedElementArray row, int columnPosition, Blob x) throws SQLException { long len = x.length(); if (len <= Integer.MAX_VALUE) { if (x instanceof BufferedBlob) { row.setObject(columnPosition - 1, ((BufferedBlob)x).getAsLastChunk(), SnappyType.BLOB); } else { setBytes(row, columnPosition, x.getBytes(1, (int)len)); } } else { throw ThriftExceptionUtil.newSQLException( SQLState.BLOB_TOO_LARGE_FOR_CLIENT, null, len, Integer.MAX_VALUE); } }
/** * {@inheritDoc} */ @Override public final void setBoolean(int parameterIndex, boolean x) throws SQLException { checkValidParameterIndex(parameterIndex); Converters.getConverter(getType(parameterIndex), "boolean", true, parameterIndex).setBoolean(this.paramsList, parameterIndex, x); }
/** * {@inheritDoc} */ @Override public final void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException { checkValidParameterIndex(parameterIndex); Converters.getConverter(getType(parameterIndex), "CharacterStream", true, parameterIndex).setCharacterStream(this.paramsList, parameterIndex, reader, length, this.service); }
/** * {@inheritDoc} */ @Override public final void updateByte(int columnIndex, byte x) throws SQLException { final Row currentRow = checkValidColumn(columnIndex); initRowUpdate("updateByte"); ColumnValueConverter cvc = Converters.getConverter( getSnappyType(columnIndex, currentRow), "byte", true, columnIndex); cvc.setByte(currentRow, columnIndex, x); this.changedColumns.set(columnIndex - 1); }
/** * {@inheritDoc} */ @Override public final void setDate(int parameterIndex, java.sql.Date x) throws SQLException { checkValidParameterIndex(parameterIndex); Converters.getConverter(getType(parameterIndex), "java.sql.Date", true, parameterIndex).setDate(this.paramsList, parameterIndex, 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 setBlob(int parameterIndex, Blob x) throws SQLException { checkValidParameterIndex(parameterIndex); Converters.getConverter(getType(parameterIndex), "blob", true, parameterIndex).setBlob(this.paramsList, parameterIndex, x); }
/** * {@inheritDoc} */ @Override public final void setBytes(int parameterIndex, byte[] x) throws SQLException { checkValidParameterIndex(parameterIndex); Converters.getConverter(getType(parameterIndex), "byte[]", true, parameterIndex).setBytes(this.paramsList, parameterIndex, x); }