ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Lamey <cla...@localmatters.com>
Subject Re: Desktop apps with iBatis
Date Tue, 22 May 2007 14:52:41 GMT

We have an API in front of a database schema that uses iBATIS as the DB
interface.  This API is used by swing, command line, and web
applications.  It is packaged in a jar file with an external
configuration file.  The jar file has all the iBATIS sqlmap xml files
and all of the Spring context files.  The external configuration file is
a properties file that has just a few things like the JDBC URL, DB user,
and DB password.  Any application that needs to interface with that
schema can just pull in the jar file like a third party lib, change a
few properties, and go.

The Spring context can be initialized externally or by an init() method
in the API.  The external initialization is mainly used by webapps who
do so via web.xml.  They do have to know which Spring context files in
the API jar to reference via the "classpath:" specifier.  The init()
method is mainly called by the swing and command line main()
applications, although there's no reason they couldn't do the Spring
initialization themselves.

All DataSources are expected to be in JNDI.  For web applications, each
servlet container has its own way of registering JNDI resources.  For
the swing and standalone apps, the init() method puts DataSources in
JNDI via Spring's SimpleNamingContextBuilder before initializing Spring.


On Tue, 2007-05-22 at 00:02 -0300, Caio Zanchetti wrote:
> Hello,
> I'm developing an application that initially will need to have a
> temporary desktop-based GUI (using Swing, for database tests purpose).
> But this app will be web-based in a few months.
> What I would like to know is how can I build this app using the
> integration between iBatis and Spring somehow that it works for this
> distinct plataforms (web and desktop)? If it possible, of course.
> Regards, 
> -- 
> Claudiomir G. Zanchetti (Caio)
> Sun Certified Programmer for the Java 2 Plataform, Standard Edition
> 5.0
> "Use com sabedoria a mente e energia para beneficiar ambos, vocĂȘ mesmo
> e os outros." -Dr. Jigoro Kano

View raw message