<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默認(rèn)的數(shù)據(jù)庫為derby,這個(gè)當(dāng)然不能在生產(chǎn)環(huán)境中使用,而且也不方便調(diào)試和管理。雖然ofbiz也支持很多的開源數(shù)據(jù)庫,例如mysql等,但是我們這里還是使用主流的數(shù)據(jù)庫系統(tǒng)oracle 11g.詳細(xì)的操作如下
    1.更新JDBC驅(qū)動,將oracle最新的jdbc驅(qū)動copy到${ofbiz install dir}/framework/entity/lib/jdbc 目錄下。
    2.設(shè)置實(shí)體引擎( Entity Engine)的缺省數(shù)據(jù)庫為oracle.在修改 ${ofbiz install dir}/framework/entity/config/entityengine.xml文件中修改配置:
       a.修改數(shù)據(jù)庫連接參數(shù):
         <datasource name="localoracle"
                helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
                schema-name="ofbiz" 你的數(shù)據(jù)庫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為你的數(shù)據(jù)庫SID
                    jdbc-username="ofbiz"  用戶名
                    jdbc-password="ofbiz"  密碼
                    pool-minsize="2"
                    pool-maxsize="250"/>
        </datasource>
      b. 修改實(shí)體引擎的數(shù)據(jù)庫缺省配置如下:(將datasource-name的值設(shè)置為“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.補(bǔ)充:在進(jìn)行以上配置時(shí),請確保你已經(jīng)存在ofbiz的數(shù)據(jù)庫,實(shí)例,用戶等都已創(chuàng)建好。
    4. 初始化數(shù)據(jù)和導(dǎo)入:   
         ofbiz$ java -jar ofbiz.jar -install
    通過以上命令即可進(jìn)行數(shù)據(jù)庫的初始化和初始數(shù)據(jù)的導(dǎo)入,這里包括了ofbiz自帶的例子,應(yīng)用的所有的數(shù)據(jù)表和初始化數(shù)據(jù)

    5.問題:
    在使用oracle數(shù)據(jù)庫時(shí),當(dāng)前的版本可能會碰到ORA-01843:無效的月份的問題      

        以sys用戶登陸并創(chuàng)建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的權(quán)限,同時(shí)ofbiz用戶比需要有UNLIMITED TABLESPACE的權(quán)限,否則在創(chuàng)建數(shù)據(jù)表的時(shí)候會報(bào)“數(shù)據(jù)庫空間不足”的錯(cuò)誤,導(dǎo)致無法創(chuàng)建表。

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

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

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

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


    網(wǎng)站導(dǎo)航:
     
    <2009年9月>
    303112345
    6789101112
    13141516171819
    20212223242526
    27282930123
    45678910

    常用鏈接

    留言簿(17)

    隨筆分類

    隨筆檔案

    文章檔案

    blog

    搜索

    •  

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 中文字幕免费播放| 在线观看永久免费| 亚洲日本中文字幕| 好先生在线观看免费播放| 又长又大又粗又硬3p免费视频| 亚洲AV中文无码乱人伦下载| 日韩高清在线免费观看| 三级黄色免费观看| 亚洲av中文无码字幕色不卡| 亚洲女同成av人片在线观看| 日本精品人妻无码免费大全| a色毛片免费视频| 亚洲AV女人18毛片水真多| 亚洲欧洲国产精品你懂的| 国产精品免费视频一区| 精品久久8x国产免费观看| 无码AV动漫精品一区二区免费| 亚洲AV色吊丝无码| 亚洲精品无码午夜福利中文字幕 | 18禁美女黄网站色大片免费观看| 亚洲国产成人久久精品软件| 亚洲色图国产精品| 亚洲综合色在线观看亚洲| 国产乱码免费卡1卡二卡3卡| 免费看黄的成人APP| 国产亚洲综合久久| 亚洲人成网男女大片在线播放| 久久亚洲中文字幕精品一区| 国产男女猛烈无遮档免费视频网站| 2021国内精品久久久久精免费| 女人隐私秘视频黄www免费| 国产精品亚洲lv粉色| 亚洲一级免费视频| 亚洲国产人成网站在线电影动漫 | 免费观看的毛片大全| 国产在线精品免费aaa片| 美女无遮挡免费视频网站| 国产精品高清视亚洲精品| 老汉色老汉首页a亚洲| 亚洲精品国产成人片| 国产亚洲精品拍拍拍拍拍|