Wlid Yemah wrote:


just as proposed by Bruce, whenever I want to force
Castor to reload the mapping files, I just give a
different database name for example "care4u1" and then
"care4u2" in the example below. Notice that in my
case, I do not have a database configuration file, I
construct the string on the fly like this:

String strDatabaseFileAsString = "

<databases>
    <database name="care4u1" engine="sapdb">
        <driver
class-name="com.sap.dbtech.jdbc.DriverSapDB"
                url="jdbc:sapdb://pclab/telecare">
           <param name="user" value="telecare" />
           <param name="password" value="telecare" />
        </driver>
        <mapping href="/home/Software/demo-jdo1.xml"
/>
    </database> ";

and then I load it with:

jdo.loadConfiguration(new InputSource(new
StringReader(strDatabaseFileAsString)), null, null);

Hope this will be of help.

Good luck,
wy

Even though this solution works for Wy, I would not recommend embedding the databse descriptor in the Java source code. This defeats the purpose of having an external database descriptor in the first place. The real power with descriptors like this is that configuration data can be changed *without having to cut new code ane recompile*. This is key in the world of enterprise development using application servers where deployments can become terribly complex.


I have a code example ready for Emir, I'll publish it today to the list.

Bruce
--
perl -e 'print unpack("u30","<0G)[EMAIL PROTECTED]&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'


The Castor Project
http://www.castor.org/

Apache Geronimo
http://incubator.apache.org/projects/geronimo.html

----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev




Reply via email to