ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ole Trenner <ole.tren...@googlemail.com>
Subject Re: how tp pass schema name in a query
Date Fri, 12 Oct 2007 18:24:12 GMT
Hemant.Kamatgi wrote:
> Is there a way
> where I can pass the schema name from out side as a parameter so that we
> can maintain only one map file I mean, say for a query ,  ‘select * from
> <schema>.employee’ where <schema> is a place holder for a value that can
> be configured.

In fact there is. In your sqlmap-config.xml you can define a properties

<properties resource="sqlmapconfig.properties" />

sqlmapconfig.properties looks like this:


Then you can use named properties everywhere in your sql mappings:

<select id="sampleSelect" parameterClass="..." resultClass="...">
    select * from ${schema1}.tablename


View raw message