Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 50840 invoked from network); 3 May 2005 18:20:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 May 2005 18:20:51 -0000 Received: (qmail 31979 invoked by uid 500); 3 May 2005 17:43:08 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 31968 invoked by uid 500); 3 May 2005 17:43:07 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 31947 invoked by uid 99); 3 May 2005 17:43:06 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from metalexis.com (HELO metalexis.com) (200.46.204.192) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 03 May 2005 10:42:58 -0700 Received: from metalexis.com (unknown [207.108.40.31]) by metalexis.com (Postfix) with ESMTP id 9480C107B35D for ; Tue, 3 May 2005 18:41:09 +0100 (BST) Message-ID: <4277B74D.4090502@metalexis.com> Date: Tue, 03 May 2005 12:39:25 -0500 From: Matt Goodwin User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jakarta Commons Users List Subject: Re: [Slightly OT] JNDI question References: <42779BA1.7050608@whirlycott.com> In-Reply-To: <42779BA1.7050608@whirlycott.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I don't have a slick trick, but what I do is get my datasources from a dbhelper class. In that class I try to read from jndi, if I can't get access to jndi I read from a config file that sits on the classpath. In Tomcat it gets the connection from jndi, for tests i create it from the config file. Of course you can use a filesystem jndi implementation that does the same thing (so I've read), but I guess I took the easy way out. Wish I had some slick way of doing this. Matt WHIRLYCOTT wrote: > I'm wondering if somone has any creative ideas here. I'm working on a > project that gets javax.sql.DataSource instances via Tomcat's JNDI > provider. This works fine, except when we are developing code and > need to run Junit tests. > > Because the tests need to run outside Tomcat, getting access to a > DataSource via JNDI becomes a pain in the neck. > > I'm assuming that this is a very common situation and I'm wondering if > anybody has slick tricks for your dev environments that allow you do > get DataSource objects via JNDI...? > > phil. > -- Matt Goodwin mgoodwin@metalexis.com (515)708-0114 Metalexis "Transcending the Ordinary" --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org