db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guy Galil <guy_ga...@guardium.com>
Subject Re: use same conf with more than one databases
Date Fri, 04 Feb 2005 20:26:44 GMT
What's hardcoded in the base classes is a logical name that points to
settings in Torque.properties - if you have each developer use a
different properties file then they can access different databases.
Another alternative is to override the hardcoded database name by
specifying a database name on each torque method call, all Torque
methods such as save, doSelect, delete can be called with either a
String database name or a connection object, off-course this might
require massive code changes.
The third alternative is to change configuration at run time, I have
code that do this for Torque 3.02 that does not work with newer
versions. The idea is to get the Configuration object, change some
settings and reconfigure Torque.
It requires some digging into the Torque code but is doable.
I can provide the 3.02 code if you want but I know those things changed
since that version.
 
On Fri, 2005-02-04 at 15:05, Αντώνης Λεμπέσης wrote:
> Hello,
> 
> In a quite large project we need to use a different database for each 
> developer. The schema is obviously the same for each one, but it turns 
> out that even if we change the torque.properties and build.properties 
> files, we still have to rebuild and compile everything because the 
> connection info is hardcoded into the autogenerated Base* classes.
> 
> Is there any way to get around this? After a while it has proven to be 
> really annoying...
> 
> Cheers,
> Antonis.
> 
> 
> ---------------------------------------------------------------------
> 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


Mime
View raw message