ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J Aaron Farr" <fa...@apache.org>
Subject FYI: iBatis in Eclipse Plugins
Date Tue, 29 Mar 2005 20:40:44 GMT
Just an FYI in case anyone else decides to use iBatis inside an Eclipse
plugin.  You need to set the Resources default classloader for everything
to work correctly.  Here's an example:

	    ClassLoader loader = MyPlugin.class.getClassLoader();
	    Resources.setDefaultClassLoader(loader);
	    Reader reader = Resources.getResourceAsReader("/conf/dao.xml");
	    _manager = DaoManagerBuilder.buildDaoManager(reader);

This assumes a file layout something like:

   /eclipse
      /plugins
         /com.company.myplugin
              plugin.xml
              myplugin.jar
              /conf
                  dao.xml
              ...

Similar concept works for sqlmaps.

Also, you don't have to have the iBatis jars in your own plugin.  If some
other plugin exposes them, this works just fine.

jaaron

Mime
View raw message