Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 81441 invoked from network); 5 Aug 2010 14:07:58 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 5 Aug 2010 14:07:58 -0000 Received: (qmail 3425 invoked by uid 500); 5 Aug 2010 14:07:58 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 3127 invoked by uid 500); 5 Aug 2010 14:07:56 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 3119 invoked by uid 99); 5 Aug 2010 14:07:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Aug 2010 14:07:55 +0000 X-ASF-Spam-Status: No, hits=2.3 required=10.0 tests=FREEMAIL_FROM,SPF_HELO_PASS,SPF_SOFTFAIL,T_TO_NO_BRKTS_FREEMAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of euanbegley@hotmail.com does not designate 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Aug 2010 14:07:50 +0000 Received: from sam.nabble.com ([192.168.236.26]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1Oh16X-0002bi-Dh for users@camel.apache.org; Thu, 05 Aug 2010 07:07:29 -0700 Date: Thu, 5 Aug 2010 07:07:29 -0700 (PDT) From: somemightsay To: users@camel.apache.org Message-ID: <1281017249422-2265391.post@n5.nabble.com> Subject: SQL Query Properties file MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, 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.properties")); query = props.getProperty("query"); CsvDataFormat csv = new CsvDataFormat(); from("Schedule") .startupOrder(1) .setBody(constant(query)) .to("jdbc:exampledb") .marshal(csv) .to("TargetDir"); } 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. I have looked extensively on the camel website and google but could not find an exact answer. I am using Camel 2.2. Thanks. -- View this message in context: http://camel.465427.n5.nabble.com/SQL-Query-Properties-file-tp2265391p2265391.html Sent from the Camel - Users mailing list archive at Nabble.com.