Search in sources :

Example 1 with FBWorkaroundStringField

use of org.firebirdsql.jdbc.field.FBWorkaroundStringField in project jaybird by FirebirdSQL.

the class AbstractPreparedStatement method setStringForced.

/**
 * Sets the designated parameter to the given String value. This is a
 * workaround for the ambiguous "operation was cancelled" response from the
 * server for when an oversized string is set for a limited-size field. This
 * method sets the string parameter without checking size constraints.
 *
 * @param parameterIndex
 *            the first parameter is 1, the second is 2, ...
 * @param x
 *            The String value to be set
 * @throws SQLException
 *             if a database access occurs
 */
public void setStringForced(int parameterIndex, String x) throws SQLException {
    FBField field = getField(parameterIndex);
    if (field instanceof FBWorkaroundStringField)
        ((FBWorkaroundStringField) field).setStringForced(x);
    else
        field.setString(x);
    isParamSet[parameterIndex - 1] = true;
}
Also used : FBField(org.firebirdsql.jdbc.field.FBField) FBWorkaroundStringField(org.firebirdsql.jdbc.field.FBWorkaroundStringField)

Aggregations

FBField (org.firebirdsql.jdbc.field.FBField)1 FBWorkaroundStringField (org.firebirdsql.jdbc.field.FBWorkaroundStringField)1