热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

深入解析Ofbiz12.04:实现与MySQL数据库的高效连接方法

Ofbiz自带的数据库是Derby,Derby是测试系统的数据库,不适合开发用。1.找到文件并打开\framework\entity\config\en

Ofbiz自带的数据库是Derby,Derby是测试系统的数据库,不适合开发用。

1. 找到文件并打开 \framework\entity\config\entityengine.xml,

2. 把所有的delagator 的mysql的注释去掉,然后把相应的derby的设置注释掉。

3. 修改mysql数据库源信息

helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"

field-type-name="mysql"

check-on-start="true"

add-missing-on-start="true"

check-pks-on-start="false"

use-foreign-keys="true"

join-

alias-view-columns="false"

drop-fk-use-foreign-key-keyword="true"

table-type="InnoDB"

character-set="utf8"

collate="utf8_general_ci">

jdbc-driver="com.mysql.jdbc.Driver"

jdbc-uri="jdbc:mysql://localhost:3306/ofbiz?autoRecOnnect=true"

jdbc-username="root"

jdbc-password=""

isolation-level="ReadCommitted"

pool-minsize="2"

pool-maxsize="250"

time-between-eviction-runs-millis="600000"/>

helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"

field-type-name="mysql"

check-on-start="true"

add-missing-on-start="true"

check-pks-on-start="false"

use-foreign-keys="true"

join-

alias-view-columns="false"

drop-fk-use-foreign-key-keyword="true"

table-type="InnoDB"

character-set="utf8"

collate="utf8_general_ci">

jdbc-driver="com.mysql.jdbc.Driver"

jdbc-uri="jdbc:mysql://localhost:3306/ofbizolap?autoRecOnnect=true"

jdbc-username="root"

jdbc-password=""

isolation-level="ReadCommitted"

pool-minsize="2"

pool-maxsize="250"

time-between-eviction-runs-millis="600000"/>

helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"

field-type-name="mysql"

check-on-start="true"

add-missing-on-start="true"

check-pks-on-start="false"

use-foreign-keys="true"

join-

alias-view-columns="false"

drop-fk-use-foreign-key-keyword="true"

table-type="InnoDB"

character-set="utf8"

collate="utf8_general_ci">

jdbc-driver="com.mysql.jdbc.Driver"

jdbc-uri="jdbc:mysql://localhost:3306/ofbiztenant?autoRecOnnect=true"

jdbc-username="root"

jdbc-password=""

isolation-level="ReadCommitted"

pool-minsize="2"

pool-maxsize="250"

time-between-eviction-runs-millis="600000"/>

helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"

field-type-name="mysql"

check-on-start="true"

add-missing-on-start="true"

check-pks-on-start="false"

use-foreign-keys="true"

join-

alias-view-columns="false"

drop-fk-use-foreign-key-keyword="true"

table-type="InnoDB"

character-set="utf8"

collate="utf8_general_ci">

jdbc-driver="com.mysql.jdbc.Driver"

jdbc-uri="jdbc:mysql://localhost:3306/ofbiz_odbc?autoRecOnnect=true"

jdbc-username="root"

jdbc-password=""

isolation-level="ReadCommitted"

pool-minsize="2"

pool-maxsize="250"

time-between-eviction-runs-millis="600000"/>

4. 把mysql的驱动包放入 framework\entity\lib\jdbc 下



推荐阅读
author-avatar
措小爱2TU1984
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有