Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

CAMEL-7251 SqlProducer call twice the getResultSet on the PreparedStatement => This cause issue with HSQLDB (NPE) #104

Closed
wants to merge 1 commit into from

2 participants

@davsclaus

Thanks for the PR it has been applied. Do you mind closing this PR?

@boretti boretti closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 27, 2014
  1. @boretti

    SqlProducer call twice the getResultSet on the PreparedStatement => This

    boretti authored
    cause issue with HSQLDB (NPE)
This page is out of date. Refresh to see the latest.
View
4 components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlProducer.java
@@ -96,7 +96,7 @@ public void process(final Exchange exchange) throws Exception {
SqlOutputType outputType = getEndpoint().getOutputType();
log.trace("Got result list from query: {}, outputType={}", rs, outputType);
if (outputType == SqlOutputType.SelectList) {
- List<Map<String, Object>> data = getEndpoint().queryForList(ps.getResultSet());
+ List<Map<String, Object>> data = getEndpoint().queryForList(rs);
// for noop=true we still want to enrich with the row count header
if (getEndpoint().isNoop()) {
exchange.getOut().setBody(exchange.getIn().getBody());
@@ -105,7 +105,7 @@ public void process(final Exchange exchange) throws Exception {
}
exchange.getOut().setHeader(SqlConstants.SQL_ROW_COUNT, data.size());
} else if (outputType == SqlOutputType.SelectOne) {
- Object data = getEndpoint().queryForObject(ps.getResultSet());
+ Object data = getEndpoint().queryForObject(rs);
if (data != null) {
// for noop=true we still want to enrich with the row count header
if (getEndpoint().isNoop()) {
Something went wrong with that request. Please try again.