use of org.davidmoten.rx.jdbc.callable.internal.InParameterPlaceholder in project rxjava2-jdbc by davidmoten.
the class Call method setParameters.
static PreparedStatement setParameters(PreparedStatement ps, List<Object> parameters, List<ParameterPlaceholder> parameterPlaceholders, List<String> names) throws SQLException {
// TODO handle Parameter objects (named)
if (names.isEmpty()) {
int i = 0;
for (int j = 0; j < parameterPlaceholders.size() && i < parameters.size(); j++) {
ParameterPlaceholder p = parameterPlaceholders.get(j);
if (p instanceof InParameterPlaceholder) {
Util.setParameter(ps, j + 1, parameters.get(i));
i++;
}
}
} else {
// TODO
throw new RuntimeException("named paramters not implemented yet for CallableStatement yet");
// Util.setNamedParameters(ps, params, names);
}
return ps;
}
Aggregations