Apache ActiveMQ ™ -- JDBC Support

Features > Persistence > JDBC Support

We support a range of SQL databases for message persistence such as

  • Apache Derby
  • Axion
  • DB2
  • HSQL
  • Informix
  • MaxDB
  • MySQL
  • Oracle
  • Postgresql
  • SQLServer
  • Sybase

as well as a number of generic JDBC providers.

Auto-discovery of your JDBC provider

We try to auto-detect from the JDBC driver which JDBCAdapter to use via these config files and the return string from the JDBC driver.

If you have a JDBC database which we don't support then please let us know what JDBC driver string you're getting and drop us a note or raise an issue in our support database and we'll fix it pretty quickly.

If your database is not in the above list it is normally a matter of tweaking the StatementProvider to ensure that the JDBCMessageStore uses the right flavour of SQL. So normally most databases support one of these providers...

  • org.activemq.store.jdbc.adapter.BlobJDBCAdapter
  • org.activemq.store.jdbc.adapter.BytesJDBCAdapter
  • org.activemq.store.jdbc.adapter.DefaultJDBCAdapter
  • org.activemq.store.jdbc.adapter.ImageJDBCAdapter

You can explicitly specify the JDBC adaptor using its xbean identifier, inside the activemq.xml...

Customizing the SQL DDL

You can confiugure the various SQL datatypes - such as column sizes and so forth - using the statements element

For more info on what attributes can be set on the statements element, see the Statements class. All the settable bean properties can be used as attributes of the element.

Using MySQL

If you are using MySQL then you should set the relaxAutoCommit flag to be true. e.g.

To see this in action see the default configuration file

For AMQ 3.x

In 3.x you can specify the adapter as follows

...

results matching ""

    No results matching ""