Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 67353 invoked from network); 24 Oct 2005 16:30:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 Oct 2005 16:30:52 -0000 Received: (qmail 17228 invoked by uid 500); 24 Oct 2005 16:30:49 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 17187 invoked by uid 500); 24 Oct 2005 16:30:48 -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 17130 invoked by uid 99); 24 Oct 2005 16:30:48 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Oct 2005 09:30:48 -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 michael.campbell@gmail.com designates 72.14.204.200 as permitted sender) Received: from [72.14.204.200] (HELO qproxy.gmail.com) (72.14.204.200) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Oct 2005 09:30:46 -0700 Received: by qproxy.gmail.com with SMTP id c8so262734qbc for ; Mon, 24 Oct 2005 09:30:26 -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=i7O9BcjYD0ytMr2KiEEvNz+8R1QPMJuH9E/aUW2ZUEnIUQa1crC6K9YQ6nKmJmQuchI+kUraYx8WxpdPRRpBPKYudRuEMUXQf6RcKmdP4P9EtMRLqNB98XCyqFmvCktiLDfGNkmixMxEMmBRiW2bi/VArrVBHabe9N70Awjw3HI= Received: by 10.65.133.13 with SMTP id k13mr525224qbn; Mon, 24 Oct 2005 09:30:26 -0700 (PDT) Received: by 10.65.124.4 with HTTP; Mon, 24 Oct 2005 09:30:26 -0700 (PDT) Message-ID: <811f2f1c0510240930g55359f0fv2e23288cd75a72ca@mail.gmail.com> Date: Mon, 24 Oct 2005 12:30:26 -0400 From: Michael Campbell To: user-java@ibatis.apache.org Subject: Re: best method to get SqlMapClient in web application In-Reply-To: <20051024155016.63619.qmail@web32802.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20051024155016.63619.qmail@web32802.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 I'm using Spring's iBatis support for this. Fairly easy to set up and works very well. On 10/24/05, Ashish Kulkarni wrote: > Hello > What is the best way to get SqlMapClient in a web > application > 1 , Define a singleton pattern class, and create a > instance of SqlMapClient to use by all classes which > need to access data. > > 2, Define a AbstractClass and put method to get > SqlMapClient in constructor of this class, and then > each class which needs to get data extends this class > > > 3, Create Instance of SqlMapClient in one of the init > servlets, and store this SqlMapClient in > ServletContext and pass it as one of the parameters to > all data classes > > 4, or any other method > > Ashish > > > > > __________________________________ > Yahoo! Mail - PC Magazine Editors' Choice 2005 > http://mail.yahoo.com > -- I tend to view "truly flexible" by another term: "Make everything equally hard". -- DHH