|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.firebirdsql.jdbc.field.FBField
org.firebirdsql.jdbc.field.FBStringField
org.firebirdsql.jdbc.field.FBWorkaroundStringField
public class FBWorkaroundStringField
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.
| Field Summary |
|---|
| Fields inherited from class org.firebirdsql.jdbc.field.FBField |
|---|
field, gdsHelper, iscEncoding, javaEncoding, mappingPath, numCol, requiredType, scale |
| Constructor Summary | |
|---|---|
FBWorkaroundStringField(XSQLVAR field,
FieldDataProvider dataProvider,
int requiredType)
Create instance of this class for the specified field and result set. |
|
| Method Summary | |
|---|---|
String |
getString()
Get string value of this field. |
void |
setConnection(GDSHelper gdsHelper)
Set connection for this field. |
void |
setString(String value)
|
byte[] |
setStringForced(String value)
Set string value without any check of its length. |
void |
setTrimString(boolean trimString)
|
| Methods inherited from class org.firebirdsql.jdbc.field.FBStringField |
|---|
getAsciiStream, getBigDecimal, getBinaryStream, getBoolean, getByte, getBytes, getDate, getDate, getDouble, getFloat, getInt, getLong, getShort, getTime, getTime, getTimestamp, getTimestamp, getUnicodeStream, setAsciiStream, setBigDecimal, setBinaryStream, setBoolean, setByte, setBytes, setCharacterStream, setDate, setDate, setDouble, setFloat, setInteger, setLong, setShort, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream |
| Methods inherited from class org.firebirdsql.jdbc.field.FBField |
|---|
close, createField, getAlias, getArray, getBigDecimal, getBlob, getCharacterStream, getClob, getFieldData, getName, getObject, getObject, getRef, getRelationName, isCompatible, isInvertTimeZone, isNull, isType, setBlob, setFieldData, setNull, setObject, setRequiredType |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FBWorkaroundStringField(XSQLVAR field,
FieldDataProvider dataProvider,
int requiredType)
throws SQLException
field - instance of XSQLVAR containing field value.dataProvider - data provider for this fieldrequiredType - required type.
SQLException - if something went wrong.| Method Detail |
|---|
public void setConnection(GDSHelper gdsHelper)
setConnection in class FBFieldpublic void setTrimString(boolean trimString)
public void setString(String value)
throws SQLException
setString in class FBStringFieldSQLException
public byte[] setStringForced(String value)
throws SQLException
value - value to set.
SQLException - if something went wrong.
public String getString()
throws SQLException
getString in class FBStringFieldnull if the value is
NULL.
SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||