activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Navin Naidu <navinmna...@gmail.com>
Subject How to programmatically configure JDBC Persistence.
Date Thu, 26 Aug 2010 13:07:14 GMT
Hi,

How can I programmatically configure for jdbc persistence with apache derby.


Is this the right way to configure ?

Snippet:
**********************************************************************************************************

BrokerService broker = *new* BrokerService();

JDBCPersistenceAdapter jdbc= *new* JDBCPersistenceAdapter();

EmbeddedDataSource dataSource = *new* EmbeddedDataSource();

dataSource.setDatabaseName("derbyDb");

dataSource.setCreateDatabase("create");

jdbc.setDataDirectory("SampleData");

jdbc.setDataSource(dataSource);

broker.setUseJmx(*true*);

broker.setPersistent(*true*);

broker.setPersistenceAdapter(jdbc);

broker.addConnector("tcp://localhost:61616");

broker.start();
**********************************************************************************************************

The "derbyDb" database is created, as well as the default data directory of
activemq "activemq-data" is also getting created. But somehow "SampleData"
is not getting created.

Can I configure the persistence programmatically, or do I have to use the
config file.

-- 
Thanks & Regards,

- Navin

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message