You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Slava Imeshev <im...@yahoo.com> on 2006/11/13 20:40:40 UTC
IBATIS and mulit-vendor development (Oracle/Derby)
Hello everyone,
I have a question. What facilities does iBatis provide to support multi-db
vendor development. In other words, is it possible to develop an application
with iBatis to support seamless switch between various DB platforms (Oracle and
Derby in my case)?
I am asking because in general SQL dialects are somewhat different and
resorting to a least common denominator dialect is undesirable.
Thank you.
Slava Imeshev
Re: IBATIS and mulit-vendor development (Oracle/Derby)
Posted by Slava Imeshev <im...@yahoo.com>.
Guido,
Thanks for the tip!
Slava
--- Guido García Bernardo <gg...@tid.es> wrote:
> I faced this problem, too, and I finally wrote one sql-map file per
> dialect (oracle and mysql in my case).
>
> In my sql-map-config.xml I put something like:
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <!DOCTYPE sqlMapConfig SYSTEM
> "http://www.ibatis.com/dtd/sql-map-config-2.dtd">
> <sqlMapConfig>
> <properties resource="properties/ibatis.properties" />
> ...
> <sqlMap resource="my/package/dao/sql-map-tests.${sql.dialect}.xml"/>
> <sqlMap resource="my/package/dao/sql-map-stats.${sql.dialect}.xml"/>
> </sqlMapConfig>
>
> With a configuration file (ibatis.properties) with an entry:
> sql.dialect=oracle
>
> That doesn't really solve your problem but it helps :)
> Regards
>
> Slava Imeshev escribió:
> > Hello everyone,
> >
> > I have a question. What facilities does iBatis provide to support multi-db
> > vendor development. In other words, is it possible to develop an application
> > with iBatis to support seamless switch between various DB platforms (Oracle and
> > Derby in my case)?
> >
> > I am asking because in general SQL dialects are somewhat different and
> > resorting to a least common denominator dialect is undesirable.
> >
> > Thank you.
> >
> > Slava Imeshev
> >
> >
> >
>
>
> --
> Guido García Bernardo
>
> Tfn. +34 983 54 89 08
> ITDEUSTO - Valladolid
>
>
>
Re: IBATIS and mulit-vendor development (Oracle/Derby)
Posted by Guido García Bernardo <gg...@tid.es>.
I faced this problem, too, and I finally wrote one sql-map file per
dialect (oracle and mysql in my case).
In my sql-map-config.xml I put something like:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMapConfig SYSTEM
"http://www.ibatis.com/dtd/sql-map-config-2.dtd">
<sqlMapConfig>
<properties resource="properties/ibatis.properties" />
...
<sqlMap resource="my/package/dao/sql-map-tests.${sql.dialect}.xml"/>
<sqlMap resource="my/package/dao/sql-map-stats.${sql.dialect}.xml"/>
</sqlMapConfig>
With a configuration file (ibatis.properties) with an entry:
sql.dialect=oracle
That doesn't really solve your problem but it helps :)
Regards
Slava Imeshev escribió:
> Hello everyone,
>
> I have a question. What facilities does iBatis provide to support multi-db
> vendor development. In other words, is it possible to develop an application
> with iBatis to support seamless switch between various DB platforms (Oracle and
> Derby in my case)?
>
> I am asking because in general SQL dialects are somewhat different and
> resorting to a least common denominator dialect is undesirable.
>
> Thank you.
>
> Slava Imeshev
>
>
>
--
Guido García Bernardo
Tfn. +34 983 54 89 08
ITDEUSTO - Valladolid