tags:

views:

20

answers:

1

I'd like to use the same ibatis sqlMapConfig on many modules.

Unfortunatly only classpath-resources seems to be allowed in the resource-attribute of my sqlMap:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMapConfig PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"
"http://ibatis.apache.org/dtd/sql-map-config-2.dtd"&gt;
<sqlMapConfig>
    <sqlMap resource="myresource.xml" />
</sqlMapConfig>

This does not work:

    <sqlMap resource="file:/myresource.xml" />

Is there any way to avoid duplicity (using one ibatis-config on many classpathes)?

+1  A: 

Use the url attribute :

<sqlMap url="file:///myresource.xml" />
Colin Hebert
@user470370 oops, bad copy/paste, it's "url" not "resource".
Colin Hebert
Oh yes - thanks!!! works perfectly!!!
ah okay. i would vote up your answer as well but i am not allowed to yet.
@user470370, I'll take care of that for you :)
Jacob Relkin