Ahhhh, I just clicked on the New Message on the website and this is the
list that came up.

Thanks for the info.  I have also created a similar class.  I just
didn't know if this was the "best" or "preferred" method.

Thanks again.

Gregg

-----Original Message-----
From: Ron Grabowski [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 03, 2005 2:30 PM
To: ibatis-user-cs@incubator.apache.org
Subject: RE: Storing an SqlMapClient

I think you posted it to the C# list:
[EMAIL PROTECTED]

I have a Java project that uses this code:

public class DaoConfig {
        
  private static final DaoManager daoManager;

  static {

    try {
      String resource = "com/salientsystems/wdms/dao/dao.xml";
      Reader reader = Resources.getResourceAsReader(resource);
      daoManager = DaoManagerBuilder.buildDaoManager(reader);
    } catch (Exception e) {
        throw new RuntimeException("Could not initialize DaoConfig. 
Cause: " + e);
    }
  }

  public static DaoManager getDaomanager() {
    return daoManager;
  }

}
--- "Bolinger, Gregg D" <[EMAIL PROTECTED]> wrote:

> Thanks, but I really don't understand what you are doing here. I
> guess I
> should have mentioned I am doing this in Java.
> 
> The following code is what I need a single instance of versus having
> it
> in every DAO.
> 
> String resource  = "path/to/SqlMapConfig.xml";
> Reader reader = Resources.getResourceAsReader(resource);
> SqlMapClient sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader);
> 
> 
> Gregg
> 
> -----Original Message-----
> From: Ron Grabowski [mailto:[EMAIL PROTECTED] 
> Sent: Monday, January 03, 2005 2:18 PM
> To: ibatis-user-cs@incubator.apache.org
> Subject: Re: Storing an SqlMapClient
> 
> One of our base classes includes this code:
> 
> public class BaseSqlMapDao : IDao
> {
> 
> protected SqlMapper GetLocalSqlMap()
> {
>       return IBatisNet.DataMapper.Mapper.Instance();
> }
> 
> }
> 
> --- "Bolinger, Gregg D" <[EMAIL PROTECTED]> wrote:
> 
> > Can someone suggest the best way to store an SqlMapClient after it
> is
> > built so that it doesn't have to be done for every request.  I am
> > using
> > iBatis in a wep app.
> > 
> >  
> > 
> > Thanks.
> > 
> >  
> > 
> > Gregg
> > 
> > 
> 
> 
> 


Reply via email to