Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 89021 invoked from network); 24 Oct 2005 16:51:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 Oct 2005 16:51:01 -0000 Received: (qmail 80550 invoked by uid 500); 24 Oct 2005 16:50:59 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 80529 invoked by uid 500); 24 Oct 2005 16:50:58 -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 80517 invoked by uid 99); 24 Oct 2005 16:50:58 -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:50:58 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of jeffgbutler@gmail.com designates 64.233.162.204 as permitted sender) Received: from [64.233.162.204] (HELO zproxy.gmail.com) (64.233.162.204) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Oct 2005 09:50:56 -0700 Received: by zproxy.gmail.com with SMTP id z6so721850nzd for ; Mon, 24 Oct 2005 09:50:37 -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:references; b=JH5dMXjPo5s0lbqcULhkCYPdaJ8cTH/s1A9RUIhJAFeiCoGovIFmECeuowEWOk4U0M1fD952Vw7TgvUVFTjfSwKc9DGZRLp8R0B/tCFnGuio7u2FdLX1XbfpUNDRNCXY0j/1V1pq0p+gkgqJLlALyHh9mJvnjFWvhltgkCZYbk4= Received: by 10.37.18.45 with SMTP id v45mr7044079nzi; Mon, 24 Oct 2005 09:50:37 -0700 (PDT) Received: by 10.36.252.52 with HTTP; Mon, 24 Oct 2005 09:50:36 -0700 (PDT) Message-ID: Date: Mon, 24 Oct 2005 11:50:36 -0500 From: Jeff Butler 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: multipart/alternative; boundary="----=_Part_20558_13261043.1130172636971" 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 ------=_Part_20558_13261043.1130172636971 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I don't know if it's the best or not, but I often times put the SqlMapClien= t into the servlet context with a listener. I think this is essentially what Spring does too. Jeff Butler 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 > ------=_Part_20558_13261043.1130172636971 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
I don't know if it's the best or not, but I often times put the SqlMap= Client into the servlet context with a listener.  I think this is esse= ntially what Spring does too.
 
Jeff Butler

 
On 10/24/05, Ashish Kulkarni <kulk= arni_ash1312@yahoo.com> 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
SqlMapClien= t in constructor of this class, and then
each class which needs to get d= ata extends this class


3, Create Instance of SqlMapClient in one of the init
servle= ts, 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

------=_Part_20558_13261043.1130172636971--