Have a look at this example from the tests (there are a few more in
the same directory):
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/jdbc/JDBCPersistenceAdapterTest.java?view=markup

On 26 August 2010 14:07, Navin Naidu <navinmna...@gmail.com> wrote:
> 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
>



-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com

Reply via email to