<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 37,  comments - 53,  trackbacks - 0
    ofbiz默認的數據庫為derby,這個當然不能在生產環境中使用,而且也不方便調試和管理。雖然ofbiz也支持很多的開源數據庫,例如mysql等,但是我們這里還是使用主流的數據庫系統oracle 11g.詳細的操作如下
    1.更新JDBC驅動,將oracle最新的jdbc驅動copy到${ofbiz install dir}/framework/entity/lib/jdbc 目錄下。
    2.設置實體引擎( Entity Engine)的缺省數據庫為oracle.在修改 ${ofbiz install dir}/framework/entity/config/entityengine.xml文件中修改配置:
       a.修改數據庫連接參數:
         <datasource name="localoracle"
                helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
                schema-name="ofbiz" 你的數據庫schema名稱
                field-type-name="oracle"
                check-on-start="true"
                add-missing-on-start="true"
                alias-view-columns="false"
                join-style="ansi">
            <read-data reader-name="seed"/>
            <read-data reader-name="seed-initial"/>
            <read-data reader-name="demo"/>
            <read-data reader-name="ext"/>
            <inline-jdbc
                    jdbc-driver="oracle.jdbc.driver.OracleDriver"
                    jdbc-uri="jdbc:oracle:thin:@192.168.1.154:1521:ofbiz"  ofbiz為你的數據庫SID
                    jdbc-username="ofbiz"  用戶名
                    jdbc-password="ofbiz"  密碼
                    pool-minsize="2"
                    pool-maxsize="250"/>
        </datasource>
      b. 修改實體引擎的數據庫缺省配置如下:(將datasource-name的值設置為“localoracle”)
          <delegator name="default" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main" distributed-cache-clear-enabled="false">
            <group-map group-name="org.ofbiz" datasource-name="localoracle"/>
            <group-map group-name="org.ofbiz.olap" datasource-name="localoracle"/>
        </delegator>
        <delegator name="default-no-eca" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main" entity-eca-enabled="false" distributed-cache-clear-enabled="false">
            <group-map group-name="org.ofbiz" datasource-name="localoracle"/>
            <group-map group-name="org.ofbiz.olap" datasource-name="localoracle"/>
        </delegator>

        <!-- be sure that your default delegator (or the one you use) uses the same datasource for test. You must run "ant run-install" before running "ant run-tests" -->
        <delegator name="test" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main">
            <group-map group-name="org.ofbiz" datasource-name="localoracle"/>
            <group-map group-name="org.ofbiz.olap" datasource-name="localoracle"/>
        </delegator>
        <delegator name="other" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main">
            <group-map group-name="org.ofbiz" datasource-name="localoracle"/>
        </delegator>
    3.補充:在進行以上配置時,請確保你已經存在ofbiz的數據庫,實例,用戶等都已創建好。
    4. 初始化數據和導入:   
         ofbiz$ java -jar ofbiz.jar -install
    通過以上命令即可進行數據庫的初始化和初始數據的導入,這里包括了ofbiz自帶的例子,應用的所有的數據表和初始化數據

    5.問題:
    在使用oracle數據庫時,當前的版本可能會碰到ORA-01843:無效的月份的問題      

        以sys用戶登陸并創建Trigger:

        create or replace TRIGGER ON_CONNECT AFTER LOGON ON DATABASE
         DECLARE
         guser varchar2(30);
         begin
          SELECT sys_context('USERENV','SESSION_USER') into guser FROM dual;
             if (guser='ofbiz' or guser='OFBIZ') THEN
                EXECUTE IMMEDIATE 'alter session set nls_timestamp_format = ''YYYY-MM-DD HH24:MI:SS.FF''';
             end if;
         end;

    注意對登陸用戶名的判斷必須大小寫都要考慮.

    另:ofbiz用戶不能擁有dba的權限,同時ofbiz用戶比需要有UNLIMITED TABLESPACE的權限,否則在創建數據表的時候會報“數據庫空間不足”的錯誤,導致無法創建表。

    6.參考:
    http://blog.csdn.net/blieveme/archive/2007/10/16/1826604.aspx
    http://docs.ofbiz.org/display/~jacopoc/OFBiz+and+Oracle

    今天就到這里吧,明天繼續:) 
    posted on 2009-09-03 20:27 雪地孤鴻 閱讀(2614) 評論(3)  編輯  收藏 所屬分類: ofbiz學習

    FeedBack:
    # re: ofbiz9 + oracle 11g
    2009-09-03 22:08 | 翔子
    學習了 ~ blog很不錯  回復  更多評論
      
    # re: ofbiz9 + oracle 11g
    2009-09-04 14:38 | 99讀書人
    不錯哦3213  回復  更多評論
      
    # re: ofbiz9 + oracle 11g
    2009-09-06 19:10 | 移動彩鈴12530
    死杜甫時間跨度福建撒嬌的看法都是  回復  更多評論
      

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    <2009年9月>
    303112345
    6789101112
    13141516171819
    20212223242526
    27282930123
    45678910

    常用鏈接

    留言簿(17)

    隨筆分類

    隨筆檔案

    文章檔案

    blog

    搜索

    •  

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 啦啦啦中文在线观看电视剧免费版| 国产精品成人观看视频免费 | 亚洲成a∧人片在线观看无码 | 免费精品视频在线| 国产精品亚洲综合久久 | 中文精品人人永久免费 | 亚洲熟妇无码八AV在线播放| 日韩a级毛片免费视频| 国产一精品一AV一免费孕妇 | 亚洲日本在线免费观看| 亚洲av日韩av高潮潮喷无码| 超清首页国产亚洲丝袜| 久久久久亚洲AV无码专区网站| 亚洲国产精品自在拍在线播放| 宅男666在线永久免费观看| 国产午夜免费福利红片| 国产资源免费观看| 国产亚洲欧洲Aⅴ综合一区| 亚洲色成人中文字幕网站| 在线a亚洲v天堂网2019无码| 亚洲视频.com| 亚洲一区二区三区国产精华液| 亚洲AV成人无码网站| 一日本道a高清免费播放 | 精品亚洲一区二区三区在线播放| 亚洲一区无码精品色| 亚洲嫩模在线观看| 亚洲综合一区二区三区四区五区| 亚洲欧美日韩综合俺去了| 久久九九久精品国产免费直播| 久久久久久一品道精品免费看| 无码精品A∨在线观看免费| 免费看男女下面日出水视频| 亚洲Av无码专区国产乱码DVD| 亚洲一区二区三区电影| 亚洲av无码日韩av无码网站冲| 巨胸喷奶水视频www免费视频| 亚欧免费视频一区二区三区 | 99re6在线精品免费观看| 久久电影网午夜鲁丝片免费| 亚洲中文字幕无码久久精品1|