if (accessors[i] == null)
throw new SQLException("Cannot find parameter for column " + i + " name=\"" + paramName + "\"");
boolean isOutput = headerCells.text().endsWith("?");
if (accessors[i].getDirection() == DbParameterAccessor.INPUT_OUTPUT) {
// clone, separate into input and output
accessors[i] = new DbParameterAccessor(accessors[i]);
accessors[i].setDirection(isOutput ? DbParameterAccessor.OUTPUT : DbParameterAccessor.INPUT);
}
if (isOutput) {
columnBindings[i] = new SymbolAccessQueryBinding();
} else {
// sql server quirk. if output parameter is used in an input
// column, then
// the param should be cloned and remapped to IN/OUT
if (accessors[i].getDirection() == DbParameterAccessor.OUTPUT) {
accessors[i] = new DbParameterAccessor(accessors[i]);
accessors[i].setDirection(DbParameterAccessor.INPUT);
}
columnBindings[i] = new SymbolAccessSetBinding();
}
columnBindings[i].adapter = accessors[i];