Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 56274 invoked from network); 30 May 2006 23:02:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 30 May 2006 23:02:08 -0000 Received: (qmail 75454 invoked by uid 500); 30 May 2006 23:02:08 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 74932 invoked by uid 500); 30 May 2006 23:02:06 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 74917 invoked by uid 99); 30 May 2006 23:02:05 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 May 2006 16:02:05 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of denis.vladimirov@gmail.com designates 64.233.162.196 as permitted sender) Received: from [64.233.162.196] (HELO nz-out-0102.google.com) (64.233.162.196) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 May 2006 16:02:04 -0700 Received: by nz-out-0102.google.com with SMTP id v1so893474nzb for ; Tue, 30 May 2006 16:01:42 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=IQmWPnWOdXk6nsD+4CoVKZnlH0miZ4CTY846Ft1Vq3qOUUTA6fs3E8XDiD/FHNzk3TvbLmXDt7V+hupK+q65H1+EObDQU7Y54nSj7IeeisX8fJrPD/LOgNJqmnWq6l8XToAnnoFVkeSTQ+TyvMCuObxmzKo4vec+oVHppRKMa/I= Received: by 10.65.219.8 with SMTP id w8mr4518749qbq; Tue, 30 May 2006 16:01:42 -0700 (PDT) Received: by 10.65.205.14 with HTTP; Tue, 30 May 2006 16:01:42 -0700 (PDT) Message-ID: <20d91bd50605301601v151b1cf0g1280e2c3114e0d1@mail.gmail.com> Date: Wed, 31 May 2006 11:01:42 +1200 From: "Denis Vladimirov" To: user-java@ibatis.apache.org Subject: Re: multiple database/datasources In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Another option is to use Spring: ----------in Spring Config------------ java:comp/env/jdbc/database1DS java:comp/env/jdbc/database2DS /yourPath/ibatisSqlMapConfig.xml -----------in Java --------- /* the first 2 DAOs are the same but with the different datasource */ SameDao yourDaoDB1 = (SameDao ) new ClassPathXmlApplicationContext( "your_spring_config.xml").getBean("yourDao1"); SameDao yourDaoDB2 = (SameDao ) new ClassPathXmlApplicationContext( "your_spring_config.xml").getBean("yourDao2"); AnotherDao anotherDaoDB2 = (AnotherDao) new ClassPathXmlApplicationContext( "your_spring_config.xml").getBean("yourDao3"); Regards, Denis On 5/31/06, Marrs, Kasey wrote: > > > > I have an application that uses multiple databases to pull data from. How > do I configure the SQL map config file and the DAO configuration to access > multiple databases? > > Thanks > > <>< <>< <>< <>< <>< > Kasey Marrs > 918-573-2242 > WIT Consulting Company > ><> ><> ><> ><> ><> >