Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 77899 invoked from network); 27 Nov 2003 07:52:03 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 27 Nov 2003 07:52:03 -0000 Received: (qmail 41737 invoked by uid 500); 27 Nov 2003 07:51:37 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 41725 invoked by uid 500); 27 Nov 2003 07:51:37 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Apache Torque Users List" Reply-To: "Apache Torque Users List" Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 41707 invoked from network); 27 Nov 2003 07:51:36 -0000 Received: from unknown (HELO mail.emediapark.de) (213.185.157.5) by daedalus.apache.org with SMTP; 27 Nov 2003 07:51:36 -0000 Subject: AW: How to dynamically add new database to Torque Date: Thu, 27 Nov 2003 08:51:47 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-ID: <0FF4A0584D3A984EACF52F2F3EA5134CB973@ep01.local> content-class: urn:content-classes:message X-MS-Has-Attach: X-MimeOLE: Produced By Microsoft Exchange V6.0.4712.0 X-MS-TNEF-Correlator: Thread-Topic: How to dynamically add new database to Torque Thread-Index: AcO0sBOWZ3ZOfwWHQrCk6OFLRbKR/AAClqMQ From: "Gerhard Otte" To: "Apache Torque Users List" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N You have to start a new configuration with Configuration c =3D (Configuration)new PropertiesConfiguration("Torque.properties"); Then change youtr properties and finally call Torque.init(c); At least that worked for me. Gerhard Otte __ mailto:G.Otte@emediapark.de emediapark GmbH http://www.emediapark.de Tel:+49 (0)941 630804-2 Fax:-9 Hemauerstr.14,93047 Regensburg,Germany -----Urspr=FCngliche Nachricht----- Von: Jeremy Kincaid [mailto:Jeremy.Kincaid@intermoco.com] Gesendet: Donnerstag, 27. November 2003 07:31 An: torque-user@db.apache.org Betreff: How to dynamically add new database to Torque I am trying to find a way to dynamically add a new database to Torque after it as already been initialized. I tried retreiving the configuration from Torque and then adding properties that would normally have appeared in the torque.properties file, then called Torque.init(configuration), or Torque.setConfiguration(configuration), but these didn't work. After looking at the source code, it was easy to see why. So does anyone have an alternative for the following: Configuration config =3D Torque.getConfiguration(); //add adpater information config.addProperty( "database.newDatabase.adapter", "mysql" );=09 //add pooling information config.addProperty( "dsfactory.newDatabase.factory", "org.apache.torque.dsfactory.SharedPoolDataSourceFactory" ); config.addProperty( "dsfactory.newDatabase.defaultMaxActive", "10" ); config.addProperty( "dsfactory.newDatabase.testOnBorrow", "true" ); config.addProperty( "dsfactory.newDatabase.validationQuery", "SELECT 1" ); config.addProperty( "dsfactory.newDatabase.connection.driver", "org.gjt.mm.mysql.Driver" ); config.addProperty( "dsfactory.newDatabase.connection.url", "jdbc:mysql://localhost:3306/NewDatabase" ); Torque.init( config ); Connection newConnection =3D Torque.getConnection( "newDatabase" ); --------------------------------------------------------------------- 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