On Dec 2, 2007 5:23 AM, youhaodeyi <[EMAIL PROTECTED]> wrote: > > Thanks. ActiveMQ uses Derby database by default. But there is nowhere in the > ActiveMQ configuration file related with Derby Database setting. There is > only one place I can find to indicate the persistent: > > <persistenceAdapter> > <journaledJDBC journalLogFiles="5" > dataDirectory="${activemq.base}/activemq-data"/> > <!-- To use a different datasource, use the following syntax : --> > <!-- > <journaledJDBC journalLogFiles="5" dataDirectory="../activemq-data" > dataSource="#postgres-ds"/> > --> > </persistenceAdapter> > > It doesn't mention the database name and user name and password etc.
This is configured in the data source definition. Notice the dataSource attribute listed above that points to #postgres-ds. The # says, look in this file for another bean whose name is postgres-ds. Near the end of the activemq.xml configuration file, you'll find the following: <bean id="postgres-ds" class="org.postgresql.ds.PGPoolingDataSource"> <property name="serverName" value="localhost"/> <property name="databaseName" value="activemq"/> <property name="portNumber" value="0"/> <property name="user" value="activemq"/> <property name="password" value="activemq"/> <property name="dataSourceName" value="postgres"/> <property name="initialConnections" value="1"/> <property name="maxConnections" value="10"/> </bean> That is where you can configuration the information/metadata specific to your database connection. Bruce -- perl -e 'print unpack("u30","D0G)[EMAIL PROTECTED]&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*" );' Apache ActiveMQ - http://activemq.org/ Apache ServiceMix - http://servicemix.org/ Apache Geronimo - http://geronimo.apache.org/ Castor - http://castor.org/