이 콘텐츠는 선택한 언어로 제공되지 않습니다.

6.2. Using the Plain JDBC Adapter


Overview

This section describes how to use the plain JDBC adapter, which is the recommended adapter to use for most applications.

Example

Example 6.3, “Configuring Red Hat JBoss A-MQ to use the Plain JDBC Persistence Adapter” shows a configuration fragment that configures the plain JDBC adapter to use the Apache Derby database.

Example 6.3. Configuring Red Hat JBoss A-MQ to use the Plain JDBC Persistence Adapter

<beans ... >
  <broker ...>
  ...
1  <persistenceAdapter>
2    <jdbcPersistenceAdapter dataSource="#derby-ds" />
    </persistenceAdapter>
    ...
  <broker>
  ...
3<bean id="derby-ds" class="org.apache.derby.jdbc.EmbeddedDataSource">
    <property name="databaseName" value="derbydb"/>
    <property name="createDatabase" value="create"/>
  </bean>
1
The persistenceAdapter element wraps the configuration for the JDBC persistence adapter.
2
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.
3
The bean element specified the configuration for the Derby JDBC driver.

Configuration

Table 6.1, “Attributes for Configuring the Plain JDBC Persistence Adapter” describes the attributes used to configure the plain JDBC persistence adapter.
Table 6.1. Attributes for Configuring the Plain JDBC Persistence Adapter
AttributeDefault ValueDescription
adapter  Specifies the strategy to use when accessing a non-supported database. For more information see the section called “Using generic JDBC providers”.
cleanupPeriod 300000Specifies, in milliseconds, the interval at which acknowledged messages are deleted.
createTablesOnStartup trueSpecifies 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-dataSpecifies the directory into which the default Derby database writes its files.
dataSource #derbySpecifies the id of the Spring bean storing the JDBC driver's configuration. For more information see the section called “Configuring your JDBC driver”.
transactionIsolationConnection.TRANSACTION_READ_UNCOMMITTEDSpecifies the required transaction isolation level. For allowed values, see java.sql.Connection.
useLocktrueSpecifies in the adapter uses file locking.
lockKeepAlivePeriod30000Specifies the time period, in milliseconds, at which the current time is saved in the locker table to ensure that the lock does not timeout. 0 specifies unlimited time.
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.