日期:2014-05-16  浏览次数:20453 次

jBPM5.4-04:使用MySql数据库

1.下载MySql驱动放在安装目录/db/drivers/下。这里将名字修改为mysql.jar。

? ? 在MySql数据库中创建task和jbpm数据库。

2.修改db/jbpm-persistence-JPA2.xml和task-persistence-JPA2.xml,修改方式类似

将
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
或
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
修改为
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect" />

?附:

Hibernate SQL Dialects (hibernate.dialect)

RDBMS Dialect
DB2 org.hibernate.dialect.DB2Dialect
DB2 AS/400 org.hibernate.dialect.DB2400Dialect
DB2 OS390 org.hibernate.dialect.DB2390Dialect
PostgreSQL org.hibernate.dialect.PostgreSQLDialect
MySQL

org.hibernate.dialect.MySQLDialect

org.hibernate.dialect.MySQL5Dialect

MySQL with InnoDB org.hibernate.dialect.MySQLInnoDBDialect
MySQL with MyISAM org.hibernate.dialect.MySQLMyISAMDialect
Oracle (any version) org.hibernate.dialect.OracleDialect
Oracle 9i org.hibernate.dialect.Oracle9iDialect
Oracle 10g org.hibernate.dialect.Oracle10gDialect
Sybase org.hibernate.dialect.SybaseDialect
Sybase Anywhere org.hibernate.dialect.SybaseAnywhereDialect
Microsoft SQL Server org.hibernate.dialect.SQLServerDialect
SAP DB org.hibernate.dialect.SAPDBDialect
Informix org.hibernate.dialect.InformixDialect
HypersonicSQL org.hibernate.dialect.HSQLDialect
Ingres org.hibernate.dialect.IngresDialect
Progress org.hibernate.dialect.ProgressDialect
Mckoi SQL org.hibernate.dialect.MckoiDialect
Interbase org.hibernate.dialect.InterbaseDialect
Pointbase org.hibernate.dialect.PointbaseDialect
FrontBase org.hibernate.dialect.FrontbaseDialect
Firebird org.hibernate.dialect.FirebirdDialect

?

3.修改task-service/resources/META-INF/persistence.xml
将
<properties>
      <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
      <property name="hibernate.connection.driver_class" value="org.h2.Driver"/>
      <property name="hibernate.connection.url" value="jdbc:h2:tcp://localhost/runtime/task" />
      <property name="hibernate.connection.username" value="sa"/>
      <property name="hibernate.connection.password" value=""/>
      <property name="hibernate.connection.autocommit" value="false" />
      <property name="hibernate.