Jeffrey, Take a look at the Javadoc for the Criteria class, one of the constructors takes a String dbname.
Then in your Torque.Properties file define dbname connection pool properties. For example: torque.dsfactory.dbname.factory=org.apache.torque.dsfactory.TorqueDataSource Factory torque.dsfactory.dbname.pool.defaultMaxConnections=10 torque.dsfactory.dbname.pool.maxExpiryTime=3600 torque.dsfactory.dbname.pool.connectionWaitTimeout=10 torque.dsfactory.dbname.connection.driver = com.microsoft.jdbc.sqlserver.SQLServerDriver torque.dsfactory.dbname.connection.url=jdbc:microsoft:sqlserver://mybox:1433 ;databasename=dbname;SelectMethod=cursor torque.dsfactory.dbname.connection.user = barney torque.dsfactory.dbname.connection.password = fife hth Steve > -----Original Message----- > From: Jeffrey Gehrung [mailto:jeffgehrung@;yahoo.com] > Sent: Monday, November 04, 2002 4:15 PM > To: [EMAIL PROTECTED] > Subject: Switching between DB instances > > > > All, > > I have two database instances: one on my laptop for local test, > one on our network shared by developers. The instances have > different DB names but identical internal schema (table names, > constraints, etc.). > > Is more required to switch between them than modifying the > Torque.Properties file? (I'm using decoupled Torque). Do I need > to rebuild the OM classes because a physical reference to a DB > name is wired-in at build time? Does SQLDB.MAP play some part in this? > > I ask this because I get "no DataSourceFactory configured for the > connection [network DB] at > org.apache.torqye.util.BasePeer.initTableSchema(TABLE_NAME) ..." > when I simply change the DB names/locations in the TQ.props file. > > When my app is directed at the DB which was named when I built > the OM classes (the instance on my laptop), everything works fine. > > TIA, > > > > > > > > > > -------------------------------------- > Jeff Gehrung (Sr. Programmer Analyst) > Holstein Association USA > Brattleboro VT 05302 > 802.451.4146 > [EMAIL PROTECTED] > [EMAIL PROTECTED] > I'm told > > > > --------------------------------- > Do you Yahoo!? > HotJobs - Search new jobs daily now -- To unsubscribe, e-mail: <mailto:turbine-torque-user-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:turbine-torque-user-help@;jakarta.apache.org>
