compiled = true;
for (SqlParameter callParameter : callParameters){
if (!logicalParametersIterator.hasNext()){
// Metadata has more parameters than were passed
throw new BadSqlGrammarException("JDBC Call", this.getCallString(), new SQLException("Not enough parameters provided."));
}
// The logical name is the name this parameter is known as to a client
logicalParameter = logicalParametersIterator.next();
// Map the database parameter name to the logical parameter and the logical
// parameter name to the db name
dbNameToLogicalParameterMap.put(callParameter.getName(), logicalParameter);
logicalNameToDbNameMap.put(logicalParameter.getName(), callParameter.getName());
// If this is an IN or IN/OUT parameter, map the database name to
// the value supplied by the client. Calls convertInputValue to
// give subclasses a chance to convert the provided input value.
if (callParameter.isInputValueProvided()){
if (logicalParameter instanceof NamedSqlParameterValue){
value = convertInputValue(callParameter, ((NamedSqlParameterValue)logicalParameter).getValue());
}else if (logicalParameter instanceof SqlParameterValue){
value = convertInputValue(callParameter, ((SqlParameterValue)logicalParameter).getValue());
}else{
value = null;
}
dbNameToValueMap.put(callParameter.getName(), value);
}
index++;
}
if (logicalParametersIterator.hasNext()){
// More parameters were passed than exist in the meta data
throw new BadSqlGrammarException("JDBC Call", this.getCallString(), new SQLException("Too many parameters provided."));
}
}