db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Malte Stien <ma...@stien.de>
Subject Re: How to initialize and shutdown Torque without a properties-file
Date Thu, 22 May 2003 03:25:53 GMT

sorry, I just had time to test that because I had to meet a deadline last week 
and what had to be shown there worked fine with the Torque.properties file.

I tried that and it actually did not work. I tried some variations but I can 
not make it work. It there a reference for the Torque.properties-file 
somewhere? I only can find the one for the build.properties-file.

Especially, I have the following questions:
- What does the torque.database.default-property acutally do? What happens if 
I do not specify it?
- Why do the key-strings in the Torque.properties-file carry a dsfactory in 
them and the key-strings in the example below (see quote) not.
- I presume in the example above "rego" is the database name. Is that right? 
So I put in "prj" in my case. Where does "database" come from. It is not in 
the Torque.properties-file.

If I adapt what you suggested, it looks like:
torqueConfig.addProperty("torque.database.default", "prj");
torqueConfig.addProperty("torque.database.prj.url", connectionString);
torqueConfig.addProperty("torque.database.prj.username", "postgres");
torqueConfig.addProperty("torque.database.prj.password", "");
The connectionString looks like this: jdbc:postgresql://localhost:5432/prj

Or should it look like:
torqueConfig.addProperty("torque.database.default", "prj");
torqueConfig.addProperty("torque.database.prj.adapter", "postgresql");
torqueConfig.addProperty("torque.dsfactory.prj.connection.password", "");

However, neither of the two options and many others that I tried, work 
although it works with my Torque.properties-file.

Thanks for any help on that.

On Thursday 01 May 2003 06:21, Geoff Fortytwo wrote:
> BaseConfiguration torqueConfig = new BaseConfiguration();
> torqueConfig.addProperty("log4j.rootCategory","DEBUG,default");
> torqueConfig.addProperty("log4j.appender.default","org.apache.log4j.FileApp
> torqueConfig.addProperty("log4j.appender.default.file","/jrun/logs/default/
> torqueConfig.addProperty("log4j.appender.default.layout","org.apache.log4j.
>SimpleLayout"); torqueConfig.addProperty("torque.database.default","FAKE");
> torqueConfig.addProperty("torque.database.rego.driver","oracle.jdbc.driver.
> torqueConfig.addProperty("torque.database.rego.url","FAKE");
> torqueConfig.addProperty("torque.database.rego.username","FAKE");
> torqueConfig.addProperty("torque.database.rego.password","FAKE");
> org.apache.torque.Torque.init(torqueConfig);
> At 08:21 PM 4/29/2003, you wrote:
> >Hi,
> >
> >is there any way to...
> >
> >- initialize Torque without providing a file with all the properties (as
> > in Torque.properties)?
> >I have to let the user specify the database settings during runtime of my
> >application and so I have to pass the values on to Torque somehow.
> >
> >- shuting down Torque properly?
> >The user shall be able to change the database he/she works on during
> > runtime, so I have to be able to shut Torque down and initialize it
> > again. I tried the Torque.shutdown() method but it does not seem to
> > shutdown Torque properly. I one calls Torque.isInit() after calling
> > Torque.shutdown() Torque still seems to be initialized.
> >
> >Thanks for support.
> >Malte.
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> >For additional commands, e-mail: torque-user-help@db.apache.org
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org

View raw message