paramValues.put(paramName, sqlValue);
} else {
String errMsg = Messages.getFormattedString("DatabaseDAO.errorParamMissing", new String[] {
paramName, dbConfigName });
logger.fatal(errMsg);
throw new ParameterLoadException(errMsg);
}
}
}
// Set the parameters for all the replaced params
// Set the params in the Map
int index = 1;
for (String paramName : currentSqlParamNames) {
Object sqlValue = paramValues.get(paramName);
try {
if (sqlValue != null)
dataStatement.setObject(index, sqlValue);
else {
dataStatement.setNull(index, getSqlType(sqlConfig.getSqlParams().get(paramName)));
}
} catch (SQLException sqe) {
String valueString = String.valueOf(sqlValue);
String valueClass = String.valueOf(sqlValue == null ? null : sqlValue.getClass());
String errMsg = Messages.getFormattedString("DatabaseDAO.sqlExceptionParamReplace", new String[] {
this.dbConfigName, paramName, valueString, valueClass, sqe.getMessage() });
logger.error(errMsg, sqe);
throw new ParameterLoadException(errMsg, sqe);
}
index++;
}
}