You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by nojonojo <n0...@yahoo.com> on 2009/01/21 21:44:29 UTC

sql component with no parameters

>From observing behavior and looking at the code of SqlProducer, it doesn't
seem like it's possible to use a query with no binding parameters (and thus
no body) with the SQL component.  Is this true, or is there something that
I'm missing?
-- 
View this message in context: http://www.nabble.com/sql-component-with-no-parameters-tp21591819s22882p21591819.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: sql component with no parameters

Posted by Roman Kalukiewicz <ro...@gmail.com>.
Thanks for pointing it out!

I created a JIRA for this problem already and I'm going to have it fixed
ASAP.

https://issues.apache.org/activemq/browse/CAMEL-1283

Roman

2009/1/21 nojonojo <n0...@yahoo.com>

>
> From observing behavior and looking at the code of SqlProducer, it doesn't
> seem like it's possible to use a query with no binding parameters (and thus
> no body) with the SQL component.  Is this true, or is there something that
> I'm missing?
> --
> View this message in context:
> http://www.nabble.com/sql-component-with-no-parameters-tp21591819s22882p21591819.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>

Re: sql component with no parameters

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Ah the deploy script that uploads new 2.0-SNAPSHOTS might not have
been changed for the new SVN location due the transition to a top
level project at Apache.

Willem Jiang is looking into it.

On Sat, Jan 24, 2009 at 9:32 AM, Claus Ibsen <cl...@gmail.com> wrote:
> Hi
>
> I believe Roman have fixed it. Could you try again?
>
> On Fri, Jan 23, 2009 at 5:22 PM, nojonojo <n0...@yahoo.com> wrote:
>>
>>
>> First of all, I'm using the 2.0 snapshot.
>>
>> The following yields a NullPointerException when I hit
>> http://localhost:8080/users:
>>
>>                from("restlet:http://localhost:8080/users?restletMethod=GET").to(
>>                                "sql:select usertext from user?dataSourceRef=camelDB");
>>
>> The NPE occurs at at
>> org.apache.camel.component.sql.SqlProducer$1.doInPreparedStatement(SqlProducer.java:48)
>> - it's pretty clear that it's trying to bind parameters to a
>> PreparedStatement despite the fact that there aren't any.
>>
>> The hack to get it to work is:
>>
>>                from("restlet:http://localhost:8080/users?restletMethod=GET").setBody(
>>                                constant("")).to( "sql:select usertext from user where # <>
>> 'blahblahblah'?dataSourceRef=camelDB");
>>
>> Thanks.
>>
>>
>>
>> cmoulliard wrote:
>>>
>>> What do you mean by 'no binding parameters' ?
>>> Can you provide an example of what you would like to do and the route
>>> please ?
>>>
>>>
>>> nojonojo wrote:
>>>>
>>>> From observing behavior and looking at the code of SqlProducer, it
>>>> doesn't seem like it's possible to use a query with no binding parameters
>>>> (and thus no body) with the SQL component.  Is this true, or is there
>>>> something that I'm missing?
>>>>
>>>
>>>
>>
>> --
>> View this message in context: http://www.nabble.com/sql-component-with-no-parameters-tp21591819s22882p21627566.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/

Re: sql component with no parameters

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

I believe Roman have fixed it. Could you try again?

On Fri, Jan 23, 2009 at 5:22 PM, nojonojo <n0...@yahoo.com> wrote:
>
>
> First of all, I'm using the 2.0 snapshot.
>
> The following yields a NullPointerException when I hit
> http://localhost:8080/users:
>
>                from("restlet:http://localhost:8080/users?restletMethod=GET").to(
>                                "sql:select usertext from user?dataSourceRef=camelDB");
>
> The NPE occurs at at
> org.apache.camel.component.sql.SqlProducer$1.doInPreparedStatement(SqlProducer.java:48)
> - it's pretty clear that it's trying to bind parameters to a
> PreparedStatement despite the fact that there aren't any.
>
> The hack to get it to work is:
>
>                from("restlet:http://localhost:8080/users?restletMethod=GET").setBody(
>                                constant("")).to( "sql:select usertext from user where # <>
> 'blahblahblah'?dataSourceRef=camelDB");
>
> Thanks.
>
>
>
> cmoulliard wrote:
>>
>> What do you mean by 'no binding parameters' ?
>> Can you provide an example of what you would like to do and the route
>> please ?
>>
>>
>> nojonojo wrote:
>>>
>>> From observing behavior and looking at the code of SqlProducer, it
>>> doesn't seem like it's possible to use a query with no binding parameters
>>> (and thus no body) with the SQL component.  Is this true, or is there
>>> something that I'm missing?
>>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/sql-component-with-no-parameters-tp21591819s22882p21627566.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/

Re: sql component with no parameters

Posted by nojonojo <n0...@yahoo.com>.

First of all, I'm using the 2.0 snapshot.

The following yields a NullPointerException when I hit
http://localhost:8080/users:

		from("restlet:http://localhost:8080/users?restletMethod=GET").to(
				"sql:select usertext from user?dataSourceRef=camelDB");

The NPE occurs at at
org.apache.camel.component.sql.SqlProducer$1.doInPreparedStatement(SqlProducer.java:48)
- it's pretty clear that it's trying to bind parameters to a
PreparedStatement despite the fact that there aren't any.

The hack to get it to work is:

		from("restlet:http://localhost:8080/users?restletMethod=GET").setBody(
				constant("")).to( "sql:select usertext from user where # <>
'blahblahblah'?dataSourceRef=camelDB");

Thanks.



cmoulliard wrote:
> 
> What do you mean by 'no binding parameters' ? 
> Can you provide an example of what you would like to do and the route
> please ?
> 
> 
> nojonojo wrote:
>> 
>> From observing behavior and looking at the code of SqlProducer, it
>> doesn't seem like it's possible to use a query with no binding parameters
>> (and thus no body) with the SQL component.  Is this true, or is there
>> something that I'm missing?
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/sql-component-with-no-parameters-tp21591819s22882p21627566.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: sql component with no parameters

Posted by cmoulliard <cm...@gmail.com>.
What do you mean by 'no binding parameters' ? 
Can you provide an example of what you would like to do and the route please
?


nojonojo wrote:
> 
> From observing behavior and looking at the code of SqlProducer, it doesn't
> seem like it's possible to use a query with no binding parameters (and
> thus no body) with the SQL component.  Is this true, or is there something
> that I'm missing?
> 


-----
Charles Moulliard
SOA Architect

My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
-- 
View this message in context: http://www.nabble.com/sql-component-with-no-parameters-tp21591819s22882p21626347.html
Sent from the Camel - Users mailing list archive at Nabble.com.