ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guido García Bernardo <ggb...@tid.es>
Subject Re: IBATIS and mulit-vendor development (Oracle/Derby)
Date Fri, 17 Nov 2006 14:41:22 GMT
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


Mime
View raw message