Regarding #1...
You can specify a separate location if you're willing to take control
of instantiating the ISqlMapper.
In a .NET 2.0 project I do this using the new 2.0 property
configuration scheme that allows class libraries to use app config
files.
The class library that contains my data access layer has an app.config
file with the following entry:
<Usr.ElectronicRecording.DAL.Properties.Settings>
<setting name="iBatisConfig" serializeAs="String">
<value>\eRecording\configuration\iBatis\erecSqlMap.config</value>
</setting>
</Usr.ElectronicRecording.DAL.Properties.Settings>
I then have a singleton SqlMapper class with the following InitMapper method:
protected static void InitMapper()
{
ConfigureHandler handler = new
ConfigureHandler(Configure);
DomSqlMapBuilder builder = new DomSqlMapBuilder();
_mapper =
builder.ConfigureAndWatch(Properties.Settings.Default.iBatisConfig,
handler);
}
Finally, any "top level" project has to set the value of the class
library iBatisConfig in the top level project's app.config or
web.config. That looks like this:
<Usr.ElectronicRecording.DAL.Properties.Settings>
<setting name="iBatisConfig" serializeAs="String">
<value>\eRecording\configuration\iBatis\erecSqlMap.config</value>
</setting>
</Usr.ElectronicRecording.DAL.Properties.Settings>
On 10/22/07, Chen, Xuguang <[EMAIL PROTECTED]> wrote:
>
>
>
> Hi,All:
>
> I am a new guy for ibatis.net. I meet some questions about
> ibatis.net(1.9.1&1.6.1).
> Would you help me?
>
> 1. I don't want to put the ibatis's config files at the same folder with
> web.config. Can I set the path myself?
> Such as put the SqlMap.config file in config\ folder.
>
>
> 2. Can I encrypt database connection in SqlMap.config except for
> embedded?
> 3. When I try to embed ex-properties file in SqlMap.config, I meet an
> error.
> My file like this
> <?xml version="1.0" encoding="utf-8"?>
> <sqlMapConfig
> xmlns="http://ibatis.apache.org/dataMapper"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
>
> .....
> The error message is :
> The element 'sqlMapConfig' in namespace
> 'http://ibatis.apache.org/dataMapper' has invalid child
> element 'properties' in namespace
> 'http://ibatis.apache.org/dataMapper'. List of possible
> elements expected: 'providers, database, alias, typeHandlers, sqlMaps' in
> namespace 'http://ibatis.apache.org/dataMapper'.
>
> How to do it?
>
> By the way, I tried <sqlMapConfig
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:noNamespaceSchemaLocation="SqlMapConfig.xsd">, but failed too.
>
>
> Sorry for posting three questions first time.
>
>
> Thank you very much!
>
>
> Best Regards,
>
>
>