Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 85741 invoked from network); 22 Dec 2005 15:41:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Dec 2005 15:41:49 -0000 Received: (qmail 26537 invoked by uid 500); 22 Dec 2005 15:41:47 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 26518 invoked by uid 500); 22 Dec 2005 15:41:47 -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 26507 invoked by uid 99); 22 Dec 2005 15:41:47 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Dec 2005 07:41:47 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [192.18.98.34] (HELO brmea-mail-3.sun.com) (192.18.98.34) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Dec 2005 07:41:46 -0800 Received: from fe-amer-09.sun.com ([192.18.108.183]) by brmea-mail-3.sun.com (8.12.10/8.12.9) with ESMTP id jBMFfP3F027308 for ; Thu, 22 Dec 2005 08:41:25 -0700 (MST) Received: from conversion-daemon.mail-amer.sun.com by mail-amer.sun.com (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) id <0IRW00H01OV67P00@mail-amer.sun.com> (original mail from Nathan.Maves@Sun.COM) for user-java@ibatis.apache.org; Thu, 22 Dec 2005 08:41:25 -0700 (MST) Received: from [192.168.5.100] ([24.8.39.65]) by mail-amer.sun.com (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPSA id <0IRW00322OX16IC0@mail-amer.sun.com> for user-java@ibatis.apache.org; Thu, 22 Dec 2005 08:41:25 -0700 (MST) Date: Thu, 22 Dec 2005 08:42:24 -0700 From: Nathan Maves Subject: Re: What is the best way to get data from 2 different database having same table names In-reply-to: <20051222142748.65756.qmail@web32815.mail.mud.yahoo.com> Sender: Nathan.Maves@Sun.COM To: user-java@ibatis.apache.org Message-id: <22F2121F-9C0D-4E0E-890F-EFAAC0898A56@sun.com> MIME-version: 1.0 X-Mailer: Apple Mail (2.746.2) Content-type: text/plain; format=flowed; delsp=yes; charset=US-ASCII Content-transfer-encoding: 7BIT References: <20051222142748.65756.qmail@web32815.mail.mud.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Simple dirty way would be to use the string substitution for the table name ($tableName$). If it is anything more the one query that might need this I would think about using multiple contexts. On Dec 22, 2005, at 7:27 AM, Ashish Kulkarni wrote: > Hi > I have a situation, in which i have 2 database on > suppose DB2, first database is Test1, and second is > Test2. > > There is table called names in both databases. > > I have created JNDI connection in tomcat. > > Now in my website i want to give user a option to > select one of the 2 JNDI connection, and then i must > be able to run query against that database. > > For example , if the user selects JNDI ( i will show > some meaningful name) for Test1 then get the data from > names in database Test1. > > What is the best way of doing this, if i am using > ibatis SQL Map and DAO > > Ashish > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com