camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brbornia <>
Subject Need help to load csv into database
Date Wed, 07 Mar 2012 22:02:23 GMT
Hello guys,

I'm just starting with camel, so sorry to bother you with a must likely
dummy question.

I am trying to load a csv file into database with something like this:

<camel:camelContext xmlns="">
	<camel:from uri="file:/media/arq/work/workspace/servicemix/datafeed/from/>
	<camel:split streaming="true" parallelProcessing="true">
	    <camel:tokenize token="\n" />
		<camel:tokenize token=","/>
			uri="sql:INSERT INTO mytable (id, name, event, time) 
			VALUES (#, #, #, #)?dataSourceRef=myDataSource"/>

And I know that will not work because I separated the csv line into several
messages when what I want is simple convert that line to an array or
something like that, but I just do not know how to do it.

A friend told me how to do it converting the csv lines into beans and
inserting them with JPA, but since I will be loading huge csv files very
often, I am concerned about unnecessary memory and processing use, so I
would like to do it without creating several objects.

Can you please help me?

Thank you in advance,

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message