You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2014/02/28 04:46:36 UTC

[2/2] git commit: CAMEL-7251 Fixed NPE of SqlProducer with thanks for Mathieu

CAMEL-7251 Fixed NPE of SqlProducer with thanks for Mathieu


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/687b9354
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/687b9354
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/687b9354

Branch: refs/heads/camel-2.12.x
Commit: 687b93540103b69300734e45e62ca5b8365ac17a
Parents: e44a118
Author: Willem Jiang <wi...@gmail.com>
Authored: Fri Feb 28 11:44:56 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Fri Feb 28 11:45:36 2014 +0800

----------------------------------------------------------------------
 .../main/java/org/apache/camel/component/sql/SqlProducer.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/687b9354/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlProducer.java b/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlProducer.java
index cf3b9ee..870e7b4 100644
--- a/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlProducer.java
+++ b/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlProducer.java
@@ -96,7 +96,7 @@ public class SqlProducer extends DefaultProducer {
                         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 class SqlProducer extends DefaultProducer {
                             }
                             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()) {