camel-sql

stored procedure invokation through camel sql-stored component

跟風遠走 提交于 2020-01-14 04:04:07
问题 I am new to camel sql-stored component. Currently I am using Camel 2.17.5. And I am trying to invoke oracle stored procedure from camel route. This is my route: <setHeader headerName="test"> <simple>John</simple> </setHeader> <log loggingLevel="INFO" message="value: ${headers.test}" /> <to uri="sql-stored:HELLO(VARCHAR ${headers.test},OUT VARCHAR outparam1)?dataSource=oracleDataSource"/> <log loggingLevel="INFO" message="SP result: ${body}" /> This is my stored procedure: CREATE OR REPLACE

IN clause in Apache Camel 2.18

我与影子孤独终老i 提交于 2020-01-05 07:10:36
问题 I am trying to execute a sql deletion statement within the route. The query contains an IN clause and I want to pass a Set of values to the IN clause. I am using camel-core & camel-jdbc 2.18.1 and camel-sql 2.18.0 from("direct:deleteRoute").setBody(simple("DELETE FROM TABLE_NAME WHERE ID IN (:#in:idSet)")).to(Constants.JDBC_DATA_SOURCE).end(); Value for idSet is passed in the header of the exchange with key idSet from the route, which calls direct:deleteRoute . But when I execute I get the

Camel-SQL Why using StreamList seems to load all ResultSet?

无人久伴 提交于 2019-12-21 20:44:16
问题 Hi, What am I trying to do ? I am currently working on an ESB project (apache-camel + spring boot 2) where i read a MySQL table with more than 100 000 000 rows. I empty this table 1 row at a time, transform the row and send it to another database. How am I doing this ? Currently I use camel-sql to read the data //edited .from(sql:SELECT * FROM mytable?outputType=StreamList&outpuClass=MyClass) .split(body()).streaming() .bean(mybean, "transform") .end() Problem : As I can't make a select * and

Camel Rest to dB Query, returning incorrect response

时光总嘲笑我的痴心妄想 提交于 2019-12-11 16:31:22
问题 I am trying to receive a xml message from a rest call, then make a call to the db, map each row into an object and then return the complete marshalled object as the rest response. However my db query result is being returned as the rest response even before the last process has executed. Can you please advise if there is something wrong I am doing that is resulting in the dB query being returned? Please also advise if my solution is the correct approach, As the real db query will have about

How to update only consumed sql rows with Apache Camel SQL Component?

筅森魡賤 提交于 2019-12-08 04:32:06
问题 I'm new in Camel and i try to process SQL data. If the SQL consume (select) is done, i try to update the consumed rows, but i just get a "bad SQL grammar" exception. I use the Apache Camel SQL-Component, where the starting endpoint is a sql select statement. To mark them as consumed, i use the onConsume parameter of the SQL-Component. In the select, v_table is the view of the original table t_table , which is used afterwards in the update. So the id of a row in v_table and t_table is the same

stored procedure invokation through camel sql-stored component

让人想犯罪 __ 提交于 2019-12-08 03:37:32
I am new to camel sql-stored component. Currently I am using Camel 2.17.5. And I am trying to invoke oracle stored procedure from camel route. This is my route: <setHeader headerName="test"> <simple>John</simple> </setHeader> <log loggingLevel="INFO" message="value: ${headers.test}" /> <to uri="sql-stored:HELLO(VARCHAR ${headers.test},OUT VARCHAR outparam1)?dataSource=oracleDataSource"/> <log loggingLevel="INFO" message="SP result: ${body}" /> This is my stored procedure: CREATE OR REPLACE PROCEDURE hello(param1 IN varchar2, outparam1 OUT varchar2) AS BEGIN select password INTO outparam1 from

How to insert blob using camel SQL component with Oracle Database

你。 提交于 2019-12-06 14:00:15
问题 I am trying to insert an input stream using camel SQL component (http://camel.apache.org/sql-component.html). I have the following table in Oracle Database: table EMPLOYEE(NAME varchar(32) ,SURNAME varchar(32) , PIC BLOB ); and the following route: <route> <from uri="direct:startOracle" /> <to uri="sql:INSERT INTO EMPLOYEE (Name, surname, pics) VALUES (# , # , #)?dataSource=#oracle" /> </route> when I try to run the following code: Resource r = contex.getResource("classpath:file/ciao.jpg");

How to insert blob using camel SQL component with Oracle Database

依然范特西╮ 提交于 2019-12-04 19:12:00
I am trying to insert an input stream using camel SQL component ( http://camel.apache.org/sql-component.html ). I have the following table in Oracle Database: table EMPLOYEE(NAME varchar(32) ,SURNAME varchar(32) , PIC BLOB ); and the following route: <route> <from uri="direct:startOracle" /> <to uri="sql:INSERT INTO EMPLOYEE (Name, surname, pics) VALUES (# , # , #)?dataSource=#oracle" /> </route> when I try to run the following code: Resource r = contex.getResource("classpath:file/ciao.jpg"); InputStream inputStream = r.getInputStream(); aProducerTemplate.sendBody(new Object[] {"mario", "ross"

Camel-SQL Why using StreamList seems to load all ResultSet?

大兔子大兔子 提交于 2019-12-04 14:12:48
Hi, What am I trying to do ? I am currently working on an ESB project (apache-camel + spring boot 2) where i read a MySQL table with more than 100 000 000 rows. I empty this table 1 row at a time, transform the row and send it to another database. How am I doing this ? Currently I use camel-sql to read the data //edited .from(sql:SELECT * FROM mytable?outputType=StreamList&outpuClass=MyClass) .split(body()).streaming() .bean(mybean, "transform") .end() Problem : As I can't make a select * and get all 100M rows in my RAM because it's not possibly big enough, I thougth about using streams.