Package org.firebirdsql.jdbc.field
Class FBWorkaroundStringField
- java.lang.Object
- 
- org.firebirdsql.jdbc.field.FBField
- 
- org.firebirdsql.jdbc.field.FBWorkaroundStringField
 
 
- 
 public final class FBWorkaroundStringField extends FBField Class implementing workaround for "operation was cancelled" bug in server. When we send some string data exceeding maximum length of the corresponding field causes "operation was cancelled" in remote module of the server instead of "arithmetic exception..." error. This makes code debugging harder, since error message is not very informative.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. - Author:
- Roman Rokytskyy, Mark Rotteveel
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected intpossibleCharLength- 
Fields inherited from class org.firebirdsql.jdbc.field.FBFieldfieldDescriptor, gdsHelper, requiredType, scale
 
- 
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.math.BigDecimalgetBigDecimal()java.math.BigIntegergetBigInteger()java.io.InputStreamgetBinaryStream()booleangetBoolean()bytegetByte()byte[]getBytes()java.sql.DategetDate()java.sql.DategetDate(java.util.Calendar cal)doublegetDouble()floatgetFloat()intgetInt()longgetLong()shortgetShort()java.lang.StringgetString()Get string value of this field.java.sql.TimegetTime()java.sql.TimegetTime(java.util.Calendar cal)java.sql.TimestampgetTimestamp()java.sql.TimestampgetTimestamp(java.util.Calendar cal)voidsetBigDecimal(java.math.BigDecimal value)voidsetBigInteger(java.math.BigInteger value)protected voidsetBinaryStreamInternal(java.io.InputStream in, long length)voidsetBoolean(boolean value)voidsetByte(byte value)voidsetBytes(byte[] value)protected voidsetCharacterStreamInternal(java.io.Reader in, long length)voidsetDate(java.sql.Date value)voidsetDate(java.sql.Date value, java.util.Calendar cal)voidsetDouble(double value)voidsetFloat(float value)voidsetInteger(int value)voidsetLong(long value)voidsetShort(short value)voidsetString(java.lang.String value)voidsetStringForced(java.lang.String value)Set string value without any check of its length.voidsetTime(java.sql.Time value)voidsetTime(java.sql.Time value, java.util.Calendar cal)voidsetTimestamp(java.sql.Timestamp value)voidsetTimestamp(java.sql.Timestamp value, java.util.Calendar cal)voidsetTrimString(boolean trimString)- 
Methods inherited from class org.firebirdsql.jdbc.field.FBFieldclose, createField, getAlias, getArray, getBigDecimal, getBlob, getCharacterStream, getClob, getDatatypeCoder, getDecimal, getDecimal, getFieldData, getName, getObject, getObject, getObject, getObjectConverter, getRawDateTimeStruct, getRef, getRelationName, getRowId, isInvertTimeZone, isNull, isType, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setConnection, setDecimal, setFieldData, setNull, setObject, setRawDateTimeStruct, setRequiredType, setRowId
 
- 
 
- 
- 
- 
Method Detail- 
setTrimStringpublic void setTrimString(boolean trimString) 
 - 
setStringpublic void setString(java.lang.String value) throws java.sql.SQLException- Throws:
- java.sql.SQLException
 
 - 
setStringForcedpublic void setStringForced(java.lang.String value) throws java.sql.SQLExceptionSet string value without any check of its length. This is a workaround for the problem described above.- Parameters:
- value- value to set.
- Throws:
- java.sql.SQLException- if something went wrong.
 
 - 
getStringpublic java.lang.String getString() throws java.sql.SQLExceptionGet string value of this field.- Returns:
- string value of this filed or nullif the value is NULL.
- Throws:
- java.sql.SQLException
 
 - 
getBytepublic byte getByte() throws java.sql.SQLException
 - 
getShortpublic short getShort() throws java.sql.SQLException
 - 
getIntpublic int getInt() throws java.sql.SQLException
 - 
getLongpublic long getLong() throws java.sql.SQLException
 - 
getBigDecimalpublic java.math.BigDecimal getBigDecimal() throws java.sql.SQLException- Overrides:
- getBigDecimalin class- FBField
- Throws:
- java.sql.SQLException
 
 - 
getFloatpublic float getFloat() throws java.sql.SQLException
 - 
getDoublepublic double getDouble() throws java.sql.SQLException
 - 
getBooleanpublic boolean getBoolean() throws java.sql.SQLException- Overrides:
- getBooleanin class- FBField
- Throws:
- java.sql.SQLException
 
 - 
getBinaryStreampublic java.io.InputStream getBinaryStream() throws java.sql.SQLException- Overrides:
- getBinaryStreamin class- FBField
- Throws:
- java.sql.SQLException
 
 - 
getBytespublic byte[] getBytes() throws java.sql.SQLException
 - 
getDatepublic java.sql.Date getDate(java.util.Calendar cal) throws java.sql.SQLException
 - 
getDatepublic java.sql.Date getDate() throws java.sql.SQLException
 - 
getTimepublic java.sql.Time getTime(java.util.Calendar cal) throws java.sql.SQLException
 - 
getTimepublic java.sql.Time getTime() throws java.sql.SQLException
 - 
getTimestamppublic java.sql.Timestamp getTimestamp(java.util.Calendar cal) throws java.sql.SQLException- Overrides:
- getTimestampin class- FBField
- Throws:
- java.sql.SQLException
 
 - 
getTimestamppublic java.sql.Timestamp getTimestamp() throws java.sql.SQLException- Overrides:
- getTimestampin class- FBField
- Throws:
- java.sql.SQLException
 
 - 
getBigIntegerpublic java.math.BigInteger getBigInteger() throws java.sql.SQLException- Overrides:
- getBigIntegerin class- FBField
- Throws:
- java.sql.SQLException
 
 - 
setBytepublic void setByte(byte value) throws java.sql.SQLException
 - 
setShortpublic void setShort(short value) throws java.sql.SQLException
 - 
setIntegerpublic void setInteger(int value) throws java.sql.SQLException- Overrides:
- setIntegerin class- FBField
- Throws:
- java.sql.SQLException
 
 - 
setLongpublic void setLong(long value) throws java.sql.SQLException
 - 
setFloatpublic void setFloat(float value) throws java.sql.SQLException
 - 
setDoublepublic void setDouble(double value) throws java.sql.SQLException
 - 
setBigDecimalpublic void setBigDecimal(java.math.BigDecimal value) throws java.sql.SQLException- Overrides:
- setBigDecimalin class- FBField
- Throws:
- java.sql.SQLException
 
 - 
setBooleanpublic void setBoolean(boolean value) throws java.sql.SQLException- Overrides:
- setBooleanin class- FBField
- Throws:
- java.sql.SQLException
 
 - 
setBinaryStreamInternalprotected void setBinaryStreamInternal(java.io.InputStream in, long length) throws java.sql.SQLException- Overrides:
- setBinaryStreamInternalin class- FBField
- Throws:
- java.sql.SQLException
 
 - 
setCharacterStreamInternalprotected void setCharacterStreamInternal(java.io.Reader in, long length) throws java.sql.SQLException- Overrides:
- setCharacterStreamInternalin class- FBField
- Throws:
- java.sql.SQLException
 
 - 
setBytespublic void setBytes(byte[] value) throws java.sql.SQLException
 - 
setDatepublic void setDate(java.sql.Date value, java.util.Calendar cal) throws java.sql.SQLException
 - 
setDatepublic void setDate(java.sql.Date value) throws java.sql.SQLException
 - 
setTimepublic void setTime(java.sql.Time value, java.util.Calendar cal) throws java.sql.SQLException
 - 
setTimepublic void setTime(java.sql.Time value) throws java.sql.SQLException
 - 
setTimestamppublic void setTimestamp(java.sql.Timestamp value, java.util.Calendar cal) throws java.sql.SQLException- Overrides:
- setTimestampin class- FBField
- Throws:
- java.sql.SQLException
 
 - 
setTimestamppublic void setTimestamp(java.sql.Timestamp value) throws java.sql.SQLException- Overrides:
- setTimestampin class- FBField
- Throws:
- java.sql.SQLException
 
 - 
setBigIntegerpublic void setBigInteger(java.math.BigInteger value) throws java.sql.SQLException- Overrides:
- setBigIntegerin class- FBField
- Throws:
- java.sql.SQLException
 
 
- 
 
-