• 【Moqui框架】Moqui连接各种类型的数据库


    Moqui连接mysql数据库

     各种数据库的连接文本:

    -- Derby
    <datasource group-name="transactional" database-conf-name="derby" schema-name="MOQUI">
    <inline-jdbc pool-minsize="5" pool-maxsize="50">
    <xa-properties databaseName="${moqui.runtime}/db/derby/MoquiDEFAULT" createDatabase="create"/>
    </inline-jdbc>
    <!- - <inline-jdbc jdbc-uri="jdbc:derby:MoquiDEFAULT;create=true"
    jdbc-username="moqui" jdbc-password="moqui" pool-minsize="5" pool-maxsize="50"/> - ->
    </datasource>

    -- DB2
    <datasource group-name="transactional" database-conf-name="db2" schema-name="" startup-add-missing="true" runtime-add-missing="false">
    <inline-jdbc pool-minsize="5" pool-maxsize="50">
    <xa-properties user="moqui" password="moqui" serverName="localhost" portNumber="5021" driverType="4"
    databaseName="MoquiDEFAULT"/>
    </inline-jdbc>
    <inline-jdbc jdbc-uri="jdbc:db2://localhost:5021/MoquiDEFAULT"
    jdbc-username="moqui" jdbc-password="moqui" pool-minsize="2" pool-maxsize="50"/> - ->
    </datasource>

    -- H2
    <datasource group-name="transactional" database-conf-name="h2" schema-name="">
    <inline-jdbc pool-minsize="5" pool-maxsize="50">
    <xa-properties url="jdbc:h2:${moqui.runtime}/db/h2/MoquiDEFAULT" user="sa" password=""/>
    </inline-jdbc>
    <!- - <inline-jdbc jdbc-uri="jdbc:h2:${moqui.runtime}/db/h2/MoquiDEFAULT"
    jdbc-username="sa" jdbc-password="" pool-minsize="5" pool-maxsize="50"/> - ->
    </datasource>

    -- MS SQL Server
    <datasource group-name="transactional" database-conf-name="mssql" schema-name="">
    <inline-jdbc pool-minsize="5" pool-maxsize="50">
    <xa-properties user="moqui" password="moqui" serverName="localhost" portNumber="1433" databaseName="MoquiDEFAULT"/>
    </inline-jdbc>
    <!- - <inline-jdbc jdbc-uri="jdbc:sqlserver://localhost:1433;databaseName=MoquiDEFAULT"
    jdbc-username="moqui" jdbc-password="moqui" pool-minsize="2" pool-maxsize="50"/> - ->
    </datasource>
    -->
    -- MySQL
    <datasource group-name="transactional" database-conf-name="mysql" schema-name="">
    <inline-jdbc pool-minsize="5" pool-maxsize="50">
    <xa-properties user="moqui" password="moqui" pinGlobalTxToPhysicalConnection="true"
    serverName="127.0.0.1" port="3306" databaseName="MoquiDEFAULT" autoReconnectForPools="true"
    useUnicode="true" encoding="UTF-8"/>
    </inline-jdbc>
    <!- - <inline-jdbc jdbc-uri="jdbc:mysql://127.0.0.1:3306/MoquiDEFAULT?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=UTF-8"
    jdbc-username="moqui" jdbc-password="moqui" pool-minsize="2" pool-maxsize="50"/> - ->
    </datasource>

    -- Oracle
    <datasource group-name="transactional" database-conf-name="oracle" schema-name="MOQUI">
    <inline-jdbc pool-minsize="5" pool-maxsize="50">
    <xa-properties user="moqui" password="moqui" URL="jdbc:oracle:thin:@127.0.0.1:1521:MoquiDEFAULT"/>
    </inline-jdbc>
    <!- - <inline-jdbc jdbc-uri="jdbc:oracle:thin:@127.0.0.1:1521:MoquiDEFAULT"
    jdbc-username="moqui" jdbc-password="moqui" pool-minsize="2" pool-maxsize="50"/> - ->
    </datasource>

    -- PostgreSQL
    <datasource group-name="transactional" database-conf-name="postgres" schema-name="public" startup-add-missing="true" runtime-add-missing="false">
    <inline-jdbc pool-minsize="5" pool-maxsize="50">
    <xa-properties user="moqui" password="moqui" serverName="localhost" portNumber="5432"
    databaseName="MoquiDEFAULT"/>
    </inline-jdbc>
    <!- - <inline-jdbc jdbc-uri="jdbc:postgresql://127.0.0.1/MoquiDEFAULT"
    jdbc-username="moqui" jdbc-password="moqui" pool-minsize="2" pool-maxsize="50"/> - ->
    </datasource>

    1.修改moqui untimeconfMoquiProductionConf.xml根据需要加入对应的文本:
    <entity-facade crypt-pass="MoquiProductionDefaultPassword:CHANGEME">
            <datasource group-name="transactional" database-conf-name="mysql" check-pks-on-start="true" schema-name="">
                <inline-jdbc jdbc-uri="jdbc:mysql://127.0.0.1:3306/moquitransactional?autoReconnect=true&amp;characterEncoding=UTF-8"
                    jdbc-username="moqui" jdbc-password="moqui" pool-minsize="2"
                    pool-maxsize="50" />
            </datasource>
     </entity-facade>
     2.用java  -Dmoqui.conf=conf/MoquiProductionConf.xml -jar moqui-1.0.2.war -load  加载数据。
     
     
    3.java  -Dmoqui.conf=conf/MoquiProductionConf.xml -jar moqui-1.0.2.war 启动服务

  • 相关阅读:
    ArcGIS Engine常用网址
    【转载】C# 跨线程调用控件
    win7电脑更新显卡不兼容,造成电脑开机黑屏
    js 字符串时间比较大小
    jquery 实现 table搜索功能
    php抓取网页数据遇到的问题
    php根据修改时间删除指定目录下文件
    ubuntu18.10安装redis遇到问题
    DEV通过FindFilterText自动检索gridview内容
    dev gridview 设置分组
  • 原文地址:https://www.cnblogs.com/dream-to-pku/p/5477497.html
Copyright © 2020-2023  润新知