首页 > 代码库 > Liferay7 BPM门户开发之6: Activiti数据库换为mysql
Liferay7 BPM门户开发之6: Activiti数据库换为mysql
第一步:
在mysql中创建数据库名字叫 ‘activiti‘
执行D:\activiti-5.21.0\database\create下的脚本
第二步:
打开=> apache-tomcat/webapps/activiti-explorer/WEB-INF/classes/
db.properties
修改配置文件 db.properties
db=activiti
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/activiti
jdbc.username=root
jdbc.password=root
如果是第三方程序,则修改activiti.cfg.xml
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration"> <property name="jdbcUrl" value="jdbc:mysql://localhost:3307/activiti?autoReconnect=true" /> <property name="jdbcDriver" value="com.mysql.jdbc.Driver" /> <property name="jdbcUsername" value="root" /> <property name="jdbcPassword" value="" /> <property name="databaseSchemaUpdate" value="true" /> <property name="jobExecutorActivate" value="false" /> <property name="asyncExecutorEnabled" value="true" /> <property name="asyncExecutorActivate" value="false" /> <property name="mailServerHost" value="mail.my-corp.com" /> <property name="mailServerPort" value="5025" /> <!-- <property name="eventListeners"> --><!-- <list> --><!-- <bean class="activitiLearn.MyEventListener" /> --><!-- </list> --><!-- </property> --> </bean></beans>
打开=>apache-tomcat-7.0.27/webapps/activiti-rest/WEB-INF/classes/
db.properties
修改配置文件 db.properties
db=activiti
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/activiti
jdbc.username=root
jdbc.password=root
第三步:
配置POM:
<dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.30</version></dependency>
非Maven环境则把 mysql-connector-java-5.1.18-bin.jar 复制到 lib下
第四步(类似第二、三步):
把 mysql-connector-java-5.1.18-bin.jar 复制到 lib下
=>apache-tomcat-7.0.27/webapps/activiti-rest/WEB-INF/lib
最后:
最后重启tomcat server和 检验activiti 数据库.看表是否配置OK
执行一下第三节的程序,发现数据已经能保存到mysql
Liferay7 BPM门户开发之6: Activiti数据库换为mysql