Return-Path: X-Original-To: apmail-camel-dev-archive@www.apache.org Delivered-To: apmail-camel-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 38F38E5C9 for ; Fri, 15 Mar 2013 21:33:05 +0000 (UTC) Received: (qmail 48294 invoked by uid 500); 15 Mar 2013 21:33:05 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 48247 invoked by uid 500); 15 Mar 2013 21:33:04 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 48237 invoked by uid 99); 15 Mar 2013 21:33:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Mar 2013 21:33:04 +0000 X-ASF-Spam-Status: No, hits=4.2 required=5.0 tests=HTML_MESSAGE,SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Mar 2013 21:33:00 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1UGcEx-00068H-HS for dev@camel.apache.org; Fri, 15 Mar 2013 14:32:39 -0700 Date: Fri, 15 Mar 2013 14:32:39 -0700 (PDT) From: JonasF To: dev@camel.apache.org Message-ID: <1363383159533-5729269.post@n5.nabble.com> Subject: camel-sql ignoring parameters in header if no body MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_212387_18047418.1363383159534" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_212387_18047418.1363383159534 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable When sending in a request over camel-jetty I added some parameters to the G= ET request and passed it on to an SQL statement to enrich the response. As the http request does not have body, only header fields, the SQL component ignored my parameters and failed.I added some code to the SqlProducer which resolved this issue: if (exchange.getIn().getBody() !=3D null) { if (batch) {= =20 Iterator iterator =3D exchange.getIn().getBody(Iterator.class); = =20 while (iterator !=3D null && iterator.hasNext()) { = =20 Object value =3D iterator.next(); Iterator i = =3D getEndpoint().getPrepareStatementStrategy().createPopulateIterator(sql, preparedQuery, expected, exchange, value); =20 getEndpoint().getPrepareStatementStrategy().populateStatement(ps, i, expected); ps.addBatch(); = =20 } } else { Iterator i =3D getEndpoint().getPrepareStatementStrategy().createPopulateIterator(sql, preparedQuery, expected, exchange, exchange.getIn().getBody()); = =20 getEndpoint().getPrepareStatementStrategy().populateStatement(ps, i, expected); } } else { = =20 Iterator i =3D getEndpoint().getPrepareStatementStrategy().createPopulateIterator(sql, preparedQuery, expected, exchange, null); =20 getEndpoint().getPrepareStatementStrategy().populateStatement(ps, i, expected); } This worked fine for some where clause parameters, but not for a MySQL 'limit' parameter which became quoted and would therefor become rejected.So= , should this little fix be added to the camel-sql? And should the limit parameter somehow be unquoted?Regards,Jonas F=C3=BCgedi -- View this message in context: http://camel.465427.n5.nabble.com/camel-sql-i= gnoring-parameters-in-header-if-no-body-tp5729269.html Sent from the Camel Development mailing list archive at Nabble.com. ------=_Part_212387_18047418.1363383159534--