码迷,mamicode.com
首页 > 数据库 > 详细

JBPM6工作台使用Mysql数据库

时间:2015-05-07 18:28:32      阅读:1108      评论:0      收藏:0      [点我收藏+]

标签:

前面已经安装好jbpm了。现在进行数据库的替换。很简单:

1,修改 build.properties

 原:

  

# default is H2
 H2.version=1.3.168
 db.name=h2
 db.driver.jar.name=${db.name}.jar
 db.driver.download.url=http://repo1.maven.org/maven2/com/h2database/h2/${H2.version}/h2-${H2.version}.jar
#mysql
#db.name=mysql
#db.driver.module.prefix=com/mysql
#db.driver.jar.name=mysql-connector-java-5.1.18.jar
#db.driver.download.url=https://repository.jboss.org/nexus/service/local/repositories/central/content/mysql/mysql-connector-java/5.1.18/mysql-connector-java-5.1.18.jar

改:

# default is H2
# H2.version=1.3.168
# db.name=h2
# db.driver.jar.name=${db.name}.jar
# db.driver.download.url=http://repo1.maven.org/maven2/com/h2database/h2/${H2.version}/h2-${H2.version}.jar
#mysql
db.name=mysql
db.driver.module.prefix=com/mysql
db.driver.jar.name=mysql-connector-java-5.1.18.jar
db.driver.download.url=https://repository.jboss.org/nexus/service/local/repositories/central/content/mysql/mysql-connector-java/5.1.18/mysql-connector-java-5.1.18.jar

2.修改db/jbpm-persistence-JPA2.xml:

原:
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>

改:
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>

3,修改standalone-full-wildfly-8.1.0.Final.xml
原:
<datasource jta="true" jndi-name="java:jboss/datasources/jbpmDS" pool-name="H2DS" enabled="true" use-java-context="true" use-ccm="true">
    <connection-url>jdbc:h2:tcp://localhost/~/jbpm-db;MVCC=TRUE</connection-url>
    <driver>h2</driver>
    <security>
       <user-name>sa</user-name>
    </security>
</datasource>
<drivers>
    <driver name="h2" module="com.h2database.h2">
        <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
    </driver>
</drivers>

改:
<datasource jta="true" jndi-name="java:jboss/datasources/jbpmDS" pool-name="MySQLDS" enabled="true" use-java-context="true" use-ccm="true">
    <connection-url>jdbc:mysql://localhost:3306/jbpm</connection-url>
    <driver>mysql</driver>
    <security>
       <user-name>jbpm</user-name>
       <password>jbpm</password>
    </security>
</datasource>
<driver name="mysql" module="com.mysql">
    <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>

1,这里要注意红色的字体将原来的替换:

<default-bindings context-service="java:jboss/ee/concurrency/context/default" datasource="java:jboss/datasources/jbpmDS" jms-connection-factory="java:jboss/DefaultJMSConnectionFactory" managed-executor-service="java:jboss/ee/concurrency/executor/default" managed-scheduled-executor-service="java:jboss/ee/concurrency/scheduler/default" managed-thread-factory="java:jboss/ee/concurrency/factory/default"/>
,2,注意。
db/mysql_module.xml 要与mysql的驱动包名一直如:

<module xmlns="urn:jboss:module:1.0" name="com.mysql">
<resources>
<resource-root path="mysql-connector-java-5.1.18.jar"/>
</resources>

<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>

5,运行ant命令OK

官网:http://docs.jboss.org/jbpm/v6.2/userguide/jBPMInstaller.html

 

 

JBPM6工作台使用Mysql数据库

标签:

原文地址:http://www.cnblogs.com/luocheng/p/4485561.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!