private ColumnValueConverter getConverterForSet(int snappyTypeValue, String targetType, int columnPosition) throws SQLException { ColumnValueConverter conv = getConverter(snappyTypeValue, targetType, true, columnPosition); // for the rare case when underlying type itself is a NULLTYPE don't fall // into infinite recursion but use NULL_ONLY_TYPE to fail for set* calls return (conv != NULL_TYPE) ? conv : NULL_ONLY_TYPE; }
protected final String getString(final int columnIndex, final int snappyTypeValue, final Row row) throws SQLException { ColumnValueConverter cvc = Converters.getConverter( snappyTypeValue, "String", false, columnIndex); String str = cvc.toString(row, columnIndex, this.service); this.wasNull = (str == null); return str; }
protected final Reader getCharacterStream(final int columnIndex, final int snappyTypeValue, final Row row) throws SQLException { ColumnValueConverter cvc = Converters.getConverter( snappyTypeValue, "CharacterStream", false, columnIndex); Reader v = cvc.toCharacterStream(row, columnIndex, this.service); this.wasNull = (v == null); return v; }
protected final BigDecimal getBigDecimal(final int columnIndex, final int snappyTypeValue, final Row row) throws SQLException { ColumnValueConverter cvc = Converters.getConverter( snappyTypeValue, "BigDecimal", false, columnIndex); BigDecimal v = cvc.toBigDecimal(row, columnIndex); this.wasNull = (v == null); return v; }
protected final Blob getBlob(final int columnIndex, final int snappyTypeValue, final Row row) throws SQLException { ColumnValueConverter cvc = Converters.getConverter( snappyTypeValue, "Blob", false, columnIndex); Blob v = cvc.toBlob(row, columnIndex, this.service); this.wasNull = (v == null); return v; }
protected final InputStream getAsciiStream(final int columnIndex, final int snappyTypeValue, final Row row) throws SQLException { ColumnValueConverter cvc = Converters.getConverter( snappyTypeValue, "AsciiStream", false, columnIndex); InputStream v = cvc.toAsciiStream(row, columnIndex, this.service); this.wasNull = (v == null); return v; }
protected final Date getDate(final int columnIndex, final Calendar cal, final int snappyTypeValue, final Row row) throws SQLException { ColumnValueConverter cvc = Converters.getConverter( snappyTypeValue, "Date", false, columnIndex); Date v = cvc.toDate(row, columnIndex, cal); this.wasNull = (v == null); return v; }
protected final InputStream getBinaryStream(final int columnIndex, final int snappyTypeValue, final Row row) throws SQLException { ColumnValueConverter cvc = Converters.getConverter( snappyTypeValue, "BinaryStream", false, columnIndex); InputStream v = cvc.toBinaryStream(row, columnIndex, this.service); this.wasNull = (v == null); return v; }
protected final byte getByte(final int columnIndex, final int snappyTypeValue, final Row row) throws SQLException { ColumnValueConverter cvc = Converters.getConverter( snappyTypeValue, "byte", false, columnIndex); byte v = cvc.toByte(row, columnIndex); this.wasNull = cvc.isNull(); return v; }
protected final short getShort(final int columnIndex, final int snappyTypeValue, final Row row) throws SQLException { ColumnValueConverter cvc = Converters.getConverter( snappyTypeValue, "short", false, columnIndex); short v = cvc.toShort(row, columnIndex); this.wasNull = cvc.isNull(); return v; }
protected final boolean getBoolean(final int columnIndex, final int snappyTypeValue, final Row row) throws SQLException { ColumnValueConverter cvc = Converters.getConverter( snappyTypeValue, "boolean", false, columnIndex); boolean v = cvc.toBoolean(row, columnIndex); this.wasNull = cvc.isNull(); return v; }
/** * {@inheritDoc} */ @Override public final void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException { checkValidParameterIndex(parameterIndex); Converters.getConverter(getType(parameterIndex), "BigDecimal", true, parameterIndex).setBigDecimal(this.paramsList, parameterIndex, x); }
/** * {@inheritDoc} */ @Override public final void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException { checkValidParameterIndex(parameterIndex); Converters.getConverter(getType(parameterIndex), "Object", true, parameterIndex).setObject( this.paramsList, parameterIndex, x); }
/** * {@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 setInt(int parameterIndex, int x) throws SQLException { checkValidParameterIndex(parameterIndex); Converters.getConverter(getType(parameterIndex), "int", true, parameterIndex).setInteger(this.paramsList, parameterIndex, x); }
/** * {@inheritDoc} */ @Override public final void setLong(int parameterIndex, long x) throws SQLException { checkValidParameterIndex(parameterIndex); Converters.getConverter(getType(parameterIndex), "long", true, parameterIndex).setLong(this.paramsList, parameterIndex, x); }
/** * {@inheritDoc} */ @Override public final void setDouble(int parameterIndex, double x) throws SQLException { checkValidParameterIndex(parameterIndex); Converters.getConverter(getType(parameterIndex), "double", true, parameterIndex).setDouble(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 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 updateInt(int columnIndex, int x) throws SQLException { final Row currentRow = checkValidColumn(columnIndex); initRowUpdate("updateInt"); ColumnValueConverter cvc = Converters.getConverter( getSnappyType(columnIndex, currentRow), "int", true, columnIndex); cvc.setInteger(currentRow, columnIndex, x); this.changedColumns.set(columnIndex - 1); }