// shall I write some keywords here to boost search engine ranking?

Thursday, June 15, 2006

iBatis configuration from absolute file path

iBatis is a SQL Mapping Framework which is currently in Apache Incubator.

In most of the quick start guide online, the example is normally based on the assumption that all your configuration files (no matter XML or .properties) being place relative to your classpath. The confguration in XML file to point to .properties file is something as below:

<properties resource="properties/database.properties"/>

However, after your 'quick start', you will most probably want to place your configuration file into somewhere else during your deployment.

It is ok for me to hav the SQL Config XML in classpath, but I want the .properties file it refer to being keep in an absolute path. This is because I want to keep the details such as database IP, name , username, password seperate from my program binary.

After long searching for solution, finally I found this from their Developer Guide (not User Guide):
<properties url="file:///c:/config/my.properties”/>

Wish this may help them who also facing same problem as me.



Anonymous said...

excellent post, many thanks

Dany said...

Many many tanks!