此内容没有您所选择的语言版本。

Chapter 4. Persistence Setups


4.1. Configuring Persistence for Business Central

Red Hat JBoss BPM Suite is configured to use an example data source with Java Naming and Directory Interface (JNDI) name java:jboss/datasources/ExampleDS. The example data source is not suitable for production.

To change the data source:

  1. Prepare your database:

    1. Go to the Product Downloads on the Customer Portal and select Red Hat JBoss BPM Suite.
    2. Download Red Hat JBoss BPM Suite 6.3.0 Supplementary Tools.
    3. Unzip jboss-brms-bpmsuite-6.3-supplementary-tools/ddl-scripts, for example into /tmp/ddl.
    4. Import the DDL script for your database into the database you want to use, for example:

      psql jbpm < /tmp/ddl/postgresql/postgresql-jbpm-schema.sql
      Copy to Clipboard Toggle word wrap
  2. Install the Java Database Connectivity (JDBC) driver onto your application plaform. For example, to deploy a PostgreSQL JDBC driver:

    1. Copy your JDBC jar file into EAP_HOME/modules/org/postgres/main/.
    2. Create EAP_HOME/modules/org/postgres/main/module.xml with the following content:

      <?xml version="1.0" ?>
      <module xmlns="urn:jboss:module:1.1" name="org.postgres">
          <resources>
              <!-- Change the name of the JDBC driver to match yours. -->
              <resource-root path="postgresql-9.4-1202.jdbc42.jar"/>
          </resources>
          <dependencies>
              <module name="javax.api"/>
              <module name="javax.transaction.api"/>
          </dependencies>
      Copy to Clipboard Toggle word wrap

      For further information about deploying JDBC drivers, see Install a JDBC Driver as a Core Module of the Red Hat JBoss Enterprise Application Platform Administration and Configuration Guide.

  3. Create a new data source:

    1. Open EAP_HOME/standalone/configuration/standalone.xml and locate <datasources>.
    2. Add your data source and the driver:

      <!-- Default data source not suitable for production, now disabled. -->
      <datasources>
          <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="false" use-java-context="true">
              <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
              <driver>h2</driver>
              <security>
                  <user-name>sa</user-name>
                  <password>sa</password>
              </security>
          </datasource>
      
          <!-- The new data source configuration. -->
          <datasource jndi-name="java:jboss/datasources/PostgresqlDS" pool-name="PostgresqlDS" enabled="true">
              <connection-url>jdbc:postgresql://localhost:5432/jbpm</connection-url>
              <driver>postgresql-9.4-1202.jdbc42.jar</driver>
              <security>
                  <user-name>jbpm</user-name>
                  <password>jbpm</password>
              </security>
          </datasource>
      
          <!-- The drivers section. -->
          <drivers>
              <driver name="h2" module="com.h2database.h2">
                  <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
              </driver>
              <!-- Register your new driver. -->
              <driver name="postgres" module="org.postgres">
                  <driver-class>org.postgresql.Driver</driver-class>
              </driver>
          </drivers>
      </datasources>
      Copy to Clipboard Toggle word wrap

      For more information, see Example PostgreSQL Datasource of the Red Hat JBoss Enterprise Application Platform Administration and Configuration Guide.

  4. Register the data source in Business Central:

    1. Open EAP_HOME/standalone/deployments/business-central.war/WEB-INF/classes/META-INF/persistence.xml.
    2. Locate the <jta-data-source> tag and change it to the JNDI name of your data source, for example:

      <jta-data-source>java:jboss/datasources/PostgresqlDS</jta-data-source>
      Copy to Clipboard Toggle word wrap
    3. Locate the <properties> tag and change the hibernate.dialect property, for example:

      <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
      Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat