use of org.firebirdsql.gds.ng.fields.FieldValue in project jaybird by FirebirdSQL.
the class AbstractPreparedStatement method clearParameters.
/**
* Clears the current parameter values immediately.
* <P>
* In general, parameter values remain in force for repeated use of a
* statement. Setting a parameter value automatically clears its previous
* value. However, in some cases it is useful to immediately release the
* resources used by the current parameter values; this can be done by
* calling the method <code>clearParameters</code>.
*
* @exception SQLException
* if a database access error occurs
*/
public void clearParameters() throws SQLException {
checkValidity();
if (fieldValues == null)
return;
// TODO Remove: should be based on FieldValue#isInitialized
Arrays.fill(isParamSet, false);
for (FieldValue fieldValue : fieldValues) {
fieldValue.reset();
}
}
use of org.firebirdsql.gds.ng.fields.FieldValue in project jaybird by FirebirdSQL.
the class AbstractPreparedStatement method executeSingleForBatch.
private void executeSingleForBatch(RowValue data, List<Long> results) throws SQLException {
for (int i = 0; i < fieldValues.getCount(); i++) {
FieldValue fieldValue = fieldValues.getFieldValue(i);
fieldValue.reset();
FBField field = getField(i + 1);
if (field instanceof FBFlushableField) {
// Explicitly set to null to ensure initialized property set to true
fieldValue.setFieldData(null);
((FBFlushableField) field).setCachedObject((CachedObject) data.getFieldValue(i).getCachedObject());
} else {
fieldValue.setFieldData(data.getFieldValue(i).getFieldData());
}
isParamSet[i] = true;
}
if (internalExecute(isExecuteProcedureStatement)) {
throw jdbcVersionSupport.createBatchUpdateException("Statements executed as batch should not produce a result set", SQLStateConstants.SQL_STATE_INVALID_STMT_TYPE, 0, toLargeArray(results), null);
}
results.add(getLargeUpdateCount());
}
Aggregations