camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From somemightsay <>
Subject SQL Query Properties file
Date Thu, 05 Aug 2010 14:07:29 GMT


I currently have a program which pulls data from a database and outputs it
so a csv file.

The SQL Query used is pulled in from a properties file but I would like to
be able to define this in a bean within the Camel-Context.xml rather than
using pure Java in the java class.

Currently I have (Couldn't see a code tag, apologies if there is one):

public void configure() throws Exception {
                String query;
          Properties props = new Properties();      
                     try {
                     props.load(new FileInputStream(""));
                     query = props.getProperty("query");
                 CsvDataFormat csv = new CsvDataFormat();

but is there a way to do this similar to what I am using to pull in the
database details from a properties file so that no addition code is needed
in the java class? ie.

<bean id="exampledb"
                <property name="driverClassName" value="${driverClassName}"
                <property name="url" value="${url}" />
                <property name="username" value="${username}" />
                <property name="password" value="${password}" />

I have looked extensively on the camel website and google but could not find
an exact answer. I am using Camel 2.2.

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

View raw message