ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brent Ryan" <br...@blackboard.com>
Subject RE: Spring & iBatis in non-webapp application ???
Date Mon, 19 Dec 2005 21:48:50 GMT
I think everyone can ignore this...  I should have just downloaded the
spring distribution and looked at the jpetstore example... duhhhh!
 
Brent

  _____  

From: Brent Ryan 
Sent: Monday, December 19, 2005 2:24 PM
To: ibatis-user-java@incubator.apache.org
Subject: Spring & iBatis in non-webapp application ???


I'm working on a small home grown java app server that we implement
several different transaction services on.  We currently use iBatis as
one of our transaction services for accessing the database... However,
we were wondering if there was a way to use the Spring
SqlMapClientTemplate in one of our base transactions skeletons so that
we can get all the cool functions (i.e. queryList, queryMap, etc..) as
well as the exception handling stuff without having to implement a
separate interface/implementation for each sql map.  Does anyone have
any example apps they could share or point me to a link?
 
I just hate having to implement something like this because I have to
create another interface/implementation just to use iBatis instead of
just using my interface/implementation for my transaction.
 
Here's a simplified version:
 
public class SISTransaction 
        extends DAOQueryListTransactionSkeleton
        implements DAOQueryTransaction {
    public void execute() throws TransactionException {
        
         StudentFinanceDao student_dao = 
           (StudentFinanceDao) this.getDaoService()
 
.getDataAccessObject(StudentFinanceDao.class);
 
         //Perform get student finance List query, no limiting
parameters
         List student_finance_list =
student_dao.getStudentFinanceList(null);
 
         //store result for use by Request
         this.setRecordList(student_finance_list);
    }
}
 
When really, I'd just like to implement this (I realize that I have to
some how get the sql map from the dao.xml to this class):  Any ideas?
 
public class SISTransaction 
        extends DAOQueryListTransactionSkeleton
        implements DAOQueryTransaction {
    public void execute() throws TransactionException {
        
         //Perform get student finance List query, no limiting
parameters
         List student_finance_list = this.queryForList("myQuery", null);
 
         //store result for use by Request
         this.setRecordList(student_finance_list);
    }
}
 
In order to use the spring-ibatis stuff is a J2EE container like tomcat
required?
 
All of the tutorials are based on web apps and most of the examples give
you the content of the config files, not the names of config files or
how to get spring to use that config file...  I'm guessing that's
because it's only meant to be run in a container...
 
Thanks in advance,
 
Brent

This e-mail is intended only for the personal and confidential use of
the recipient(s) named above. 
It may include Blackboard confidential and proprietary information, and
is not for redistribution.



Mime
View raw message