## Using JDBC without the Journal

### Overview

For instances when journaling is not appropriate, or you wish to use your own journaling system, you can used the JDBC persistence adapter without the FUSE Message Broker high performance journal.

### Configuration

To configure FUSE Message Broker to use the JDBC persistence adapter without the high performance journal you add the `jdbcPersistenceAdapter` element to the `persistenceAdapter` element in your broker's configuration as shown in Example 3.6.

Table 3.3 describes the attributes used to configure the journaled JDBC persistence adapter.

Table 3.3. Attributes for Configuring the Plain JDBC Persistence Adapter

Attribute | Default Value | Description
--- | --- | ---
`adapter` |  | Specifies the strategy to use when accessing a non-supported database. For more information see Using generic JDBC providers.
`cleanupPeriod` | `300000` | Specifies, in milliseconds, the interval at which acknowledged messages are deleted.
`createTablesOnStartup` | `true` | Specifies whether or not new database tables are created when the broker starts. If the database tables already exist, the existing tables are reused.
`dataDirectory` | `activemq-data` | Specifies the directory into which the default Derby database writes its files.
`dataSource` | `#derby` | Specifies the id of the Spring bean storing the JDBC driver's configuration. For more information see Configuring your JDBC driver.
`useDatabaseLock` | `true` | Specifies whether or not an exclusive database lock should be used to enable JDBC Master/Slave.

### Example

Example 3.6 shows a configuration snip-it that configures the JDBC adapter to use the default database.

Example 3.6. Configuring FUSE Message Broker to use the Plain JDBC Persistence Adapter

    <beans ...>
      <broker ...>
      ...
      <persistenceAdapter>
        <journaledJDBC dataSource="derby-ds" />
        </persistenceAdapter>
        ...
      <broker>
      ...
    <bean id="#derby-ds" class="org.apache.derby.jdbc.EmbeddedDataSource">
        <property name="databaseName" value="derbydb"/>
        <property name="createDatabase" value="create"/>
      </bean>

The configuration in Example 3.6 show three noteworthy elements:

| The `persistenceAdapter` element wraps the configuration for the JDBC persistence adapter.
| The `jdbcPersistenceAdapter` element specifies that the broker will use the plain JDBC persistence adapter and that the JDBC driver's configuration is specified in a `bean` element with the id `derby-ds`.
| The `bean` element specified the configuration for the Derby JDBC driver.