1. for Oracle 修改hibernate.cfg.xml
<property name="hibernate.dialect">
org.hibernate.dialect.Oracle9Dialect
</property>
<property name="hibernate.connection.driver_class">
oracle.jdbc.driver.OracleDriver
</property>
<property name="hibernate.connection.url">
jdbc:oracle:thin:@192.168.2.225:1521:bak
</property>
<property name="hibernate.connection.username">
scott
</property>
<property name="hibernate.connection.password">
tiger
</property>
2. for Mysql
<property name="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="hibernate.connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="hibernate.connection.url">
jdbc:mysql://localhost:3306/kq
</property>
<property name="hibernate.connection.username">
root
</property>
<property name="hibernate.connection.password">
123456
</property>
3. 建jbpm表
JbpmConfiguration.getInstance().createSchema();
4. 删除jbpm表
JbpmConfiguration.getInstance().dropSchema();
5. 部署流程
JbpmConfiguration config = JbpmConfiguration.getInstance();
// 创建一个 jbpm 容器
JbpmContext jbpmContext = config.createJbpmContext();
ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource ("simple/processdefinition.xml");
// 利用容器的方法将流程定义数据部署到数据库上
jbpmContext.deployProcessDefinition(processDefinition);
// 关闭 jbpmContext
jbpmContext.close();