public final class FBWorkaroundStringField extends FBField
However we cannot simply check length locally. Maximum allowed length in bytes is connected with the character set of the field as defined lengh * maximum number of bytes per character in that encoding. However this does not work for system tables which have defined length 31, character set UNICODE_FSS and maximum allowed length of 31 (instead of 31 * 3 = 63).
Until this bug is fixed in the engine we will simply check if field belongs to the system table and do not throw data truncation error locally.
Modifier and Type | Field and Description |
---|---|
protected EncodingDefinition |
encodingDefinition |
protected int |
possibleCharLength |
fieldDescriptor, gdsHelper, mappingPath, requiredType, scale
Modifier and Type | Method and Description |
---|---|
java.math.BigDecimal |
getBigDecimal() |
java.math.BigInteger |
getBigInteger() |
java.io.InputStream |
getBinaryStream() |
boolean |
getBoolean() |
byte |
getByte() |
byte[] |
getBytes() |
java.sql.Date |
getDate() |
java.sql.Date |
getDate(java.util.Calendar cal) |
double |
getDouble() |
protected static EncodingDefinition |
getEncodingDefinition(FieldDescriptor fieldDescriptor) |
float |
getFloat() |
int |
getInt() |
long |
getLong() |
short |
getShort() |
java.lang.String |
getString()
Get string value of this field.
|
java.sql.Time |
getTime() |
java.sql.Time |
getTime(java.util.Calendar cal) |
java.sql.Timestamp |
getTimestamp() |
java.sql.Timestamp |
getTimestamp(java.util.Calendar cal) |
void |
setBigDecimal(java.math.BigDecimal value) |
void |
setBigInteger(java.math.BigInteger value) |
protected void |
setBinaryStreamInternal(java.io.InputStream in,
long length) |
void |
setBoolean(boolean value) |
void |
setByte(byte value) |
void |
setBytes(byte[] value) |
protected void |
setCharacterStreamInternal(java.io.Reader in,
long length) |
void |
setDate(java.sql.Date value) |
void |
setDate(java.sql.Date value,
java.util.Calendar cal) |
void |
setDouble(double value) |
void |
setFloat(float value) |
void |
setInteger(int value) |
void |
setLong(long value) |
void |
setShort(short value) |
void |
setString(java.lang.String value) |
byte[] |
setStringForced(java.lang.String value)
Set string value without any check of its length.
|
void |
setTime(java.sql.Time value) |
void |
setTime(java.sql.Time value,
java.util.Calendar cal) |
void |
setTimestamp(java.sql.Timestamp value) |
void |
setTimestamp(java.sql.Timestamp value,
java.util.Calendar cal) |
void |
setTrimString(boolean trimString) |
close, createField, getAlias, getArray, getBigDecimal, getBlob, getCharacterStream, getClob, getDatatypeCoder, getFieldData, getName, getObject, getObject, getObject, getObjectConverter, getRawDateTimeStruct, getRef, getRelationName, isInvertTimeZone, isNull, isType, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setConnection, setFieldData, setNull, setObject, setRawDateTimeStruct, setRequiredType
protected final int possibleCharLength
protected final EncodingDefinition encodingDefinition
public void setTrimString(boolean trimString)
public void setString(java.lang.String value) throws java.sql.SQLException
java.sql.SQLException
public byte[] setStringForced(java.lang.String value) throws java.sql.SQLException
value
- value to set.java.sql.SQLException
- if something went wrong.public java.lang.String getString() throws java.sql.SQLException
null
if the value is
NULL.java.sql.SQLException
protected static EncodingDefinition getEncodingDefinition(FieldDescriptor fieldDescriptor) throws java.sql.SQLException
java.sql.SQLException
public byte getByte() throws java.sql.SQLException
public short getShort() throws java.sql.SQLException
public int getInt() throws java.sql.SQLException
public long getLong() throws java.sql.SQLException
public java.math.BigDecimal getBigDecimal() throws java.sql.SQLException
getBigDecimal
in class FBField
java.sql.SQLException
public float getFloat() throws java.sql.SQLException
public double getDouble() throws java.sql.SQLException
public boolean getBoolean() throws java.sql.SQLException
getBoolean
in class FBField
java.sql.SQLException
public java.io.InputStream getBinaryStream() throws java.sql.SQLException
getBinaryStream
in class FBField
java.sql.SQLException
public byte[] getBytes() throws java.sql.SQLException
public java.sql.Date getDate(java.util.Calendar cal) throws java.sql.SQLException
public java.sql.Date getDate() throws java.sql.SQLException
public java.sql.Time getTime(java.util.Calendar cal) throws java.sql.SQLException
public java.sql.Time getTime() throws java.sql.SQLException
public java.sql.Timestamp getTimestamp(java.util.Calendar cal) throws java.sql.SQLException
getTimestamp
in class FBField
java.sql.SQLException
public java.sql.Timestamp getTimestamp() throws java.sql.SQLException
getTimestamp
in class FBField
java.sql.SQLException
public java.math.BigInteger getBigInteger() throws java.sql.SQLException
getBigInteger
in class FBField
java.sql.SQLException
public void setByte(byte value) throws java.sql.SQLException
public void setShort(short value) throws java.sql.SQLException
public void setInteger(int value) throws java.sql.SQLException
setInteger
in class FBField
java.sql.SQLException
public void setLong(long value) throws java.sql.SQLException
public void setFloat(float value) throws java.sql.SQLException
public void setDouble(double value) throws java.sql.SQLException
public void setBigDecimal(java.math.BigDecimal value) throws java.sql.SQLException
setBigDecimal
in class FBField
java.sql.SQLException
public void setBoolean(boolean value) throws java.sql.SQLException
setBoolean
in class FBField
java.sql.SQLException
protected void setBinaryStreamInternal(java.io.InputStream in, long length) throws java.sql.SQLException
setBinaryStreamInternal
in class FBField
java.sql.SQLException
protected void setCharacterStreamInternal(java.io.Reader in, long length) throws java.sql.SQLException
setCharacterStreamInternal
in class FBField
java.sql.SQLException
public void setBytes(byte[] value) throws java.sql.SQLException
public void setDate(java.sql.Date value, java.util.Calendar cal) throws java.sql.SQLException
public void setDate(java.sql.Date value) throws java.sql.SQLException
public void setTime(java.sql.Time value, java.util.Calendar cal) throws java.sql.SQLException
public void setTime(java.sql.Time value) throws java.sql.SQLException
public void setTimestamp(java.sql.Timestamp value, java.util.Calendar cal) throws java.sql.SQLException
setTimestamp
in class FBField
java.sql.SQLException
public void setTimestamp(java.sql.Timestamp value) throws java.sql.SQLException
setTimestamp
in class FBField
java.sql.SQLException
public void setBigInteger(java.math.BigInteger value) throws java.sql.SQLException
setBigInteger
in class FBField
java.sql.SQLException
Copyright © 2001-2021 Jaybird (Firebird JDBC/JCA) team. All rights reserved.