Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 81226 invoked from network); 24 Aug 2006 21:48:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 Aug 2006 21:48:50 -0000 Received: (qmail 88070 invoked by uid 500); 24 Aug 2006 21:48:41 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 87869 invoked by uid 500); 24 Aug 2006 21:48:40 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 87858 invoked by uid 99); 24 Aug 2006 21:48:40 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Aug 2006 14:48:40 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of scott@indosoft.com designates 131.202.90.23 as permitted sender) Received: from [131.202.90.23] (HELO indosoft.com) (131.202.90.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Aug 2006 14:48:39 -0700 Received: from [127.0.0.1] ([192.168.1.41]) by indosoft.com (8.13.4/8.13.4/Debian-3sarge1) with ESMTP id k7OLk9wT015005 for ; Thu, 24 Aug 2006 18:46:09 -0300 Message-ID: <44EE1E99.6010305@indosoft.com> Date: Thu, 24 Aug 2006 18:48:09 -0300 From: Scott Van Wart User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: Struts Users Mailing List Subject: Re: [JAVA]How to get datatbase connection from lookup to datatsource name in a standalone java application References: <20060824214443.5978.qmail@web52609.mail.yahoo.com> In-Reply-To: <20060824214443.5978.qmail@web52609.mail.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Caroline Jen wrote: > Context ctx = new InitialContect(); > DataSource ds = > (DataSource)ctx.lookup("java:com/env/jdbc/DBName"); > Connection con = ds.getConnection(); > Right, but that's assuming it's already bound, which is the hard part, and unless he's running it under OC4J, no such luck... - Scott --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org