Activiti6-数据库配置-dbconfig(学习笔记)

常用数据连接池种类:

不一样的地方在于filters过滤器,设置了统计、和记录

avtiviti支持的数据库有:

  

<?xml version="1.0" encoding="UTF-8"?>
<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">


    <!-- 1 基于H2内存数据库 的流程引擎配置,也是在什么都没配置时的默认配置-->
    <!--
    <bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration">
        <property name="jdbcUrl" value="jdbc:h2:mem:activiti;DB_CLOSE_DELAY=1000;MVCC=TRUE" />
        <property name="jdbcDriver" value="org.h2.Driver" />
        <property name="jdbcUsername" value="sa" />
        <property name="jdbcPassword" value="" />
    </bean>
    -->

    <!-- StandaloneInMemProcessEngineConfiguration里面databaseSchemaUpdate默认为
    “create-drop”,即用时自动创建表,关闭时自动删除表(ps:对应库为空库,中必须无表)
           -->
    <bean id="processEngineConfiguration"
          class="org.activiti.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration">
        <!--<property name="jdbcUrl" value="jdbc:mysql://localhost:3306/activiti6unit?useUnicode=true&amp;characterEncoding=utf-8&amp;useSSL=false" />
        <property name="jdbcDriver" value="com.mysql.jdbc.Driver" />
        <property name="jdbcUsername" value="root" />
        <property name="jdbcPassword" value="root" />-->

        <!--默认设置-->
        <!--<property name="databaseSchemaUpdate" value="create-drop" />-->
        <property name="databaseSchemaUpdate" value="true" />

        <property name="dataSource" ref="dataSource" />

        <!-- 其他一些属性 -->
        <!-- 给表加上前缀
        <property name="databaseTablePrefix" value="t_" />
         -->

    </bean>

    <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource">
        <property name="url" value="jdbc:mysql://localhost:3306/activiti6unit?useUnicode=true&amp;characterEncoding=utf-8&amp;useSSL=false" />
        <property name="driverClassName" value="com.mysql.jdbc.Driver" />
        <property name="username" value="root" />
        <property name="password" value="root" />
        <property name="initialSize" value="1" />
        <property name="maxActive" value="10" />
        <property name="filters" value="stat,slf4j"/>
    </bean>
原文地址:https://www.cnblogs.com/xk920/p/10671222.html