激情五月天婷婷,亚洲愉拍一区二区三区,日韩视频一区,a√天堂中文官网8

<ul id="buwfs"><strike id="buwfs"><strong id="buwfs"></strong></strike></ul>
    <output id="buwfs"></output>
  • <dfn id="buwfs"><source id="buwfs"></source></dfn>
      <dfn id="buwfs"><td id="buwfs"></td></dfn>
      <div id="buwfs"><small id="buwfs"></small></div>
      <dfn id="buwfs"><source id="buwfs"></source></dfn>
      1. <dfn id="buwfs"><td id="buwfs"></td></dfn>
        始創(chuàng)于2000年 股票代碼:831685
        咨詢熱線:0371-60135900 注冊(cè)有禮 登錄
        • 掛牌上市企業(yè)
        • 60秒人工響應(yīng)
        • 99.99%連通率
        • 7*24h人工
        • 故障100倍補(bǔ)償
        全部產(chǎn)品
        您的位置: 網(wǎng)站首頁(yè) > 幫助中心>文章內(nèi)容

        配置 Gatein 為Oracle連接

        發(fā)布時(shí)間:  2012/9/16 14:06:34

        主要環(huán)境:
              JBOSS 5.1.0

              Orace 10G

              Gatein3.1.0-GA

        引用一下Gatein 官方使用手冊(cè)上的原文并簡(jiǎn)單反譯和注解一下大概意思:-
         

        2.1. Database Configuration
        2.1.1. Overview
        GateIn 3.1 has two different database dependencies. One is the identity service configuration, which depends on Hibernate. The other is Java content repository (JCR) service, which depends on JDBC API, and can integrate with any existing datasource implementation.

        When you change the database configuration for the first time, GateIn will automatically generate the proper schema (assuming that the database user has the appropriate permissions).

        GateIn 3.1 assumes the default encoding for your database is latin1. You may need to change this parameter for your database in order for GateIn 3.1 to work properly.

        概述:     主要是說(shuō)Gatein依賴兩個(gè)數(shù)據(jù)庫(kù) 一個(gè)是用來(lái)做身份認(rèn)證的,是用Hibernate的。 另一個(gè)用來(lái)支持JCR的,用JDBC API 兩個(gè)都可以支持當(dāng)前任何已存在的數(shù)庫(kù)。     在你第一次改變數(shù)據(jù)庫(kù)配置后,Gatein將會(huì)自動(dòng)的生成schema(注解:數(shù)據(jù)庫(kù)的方案,就是表,視圖等)(你的數(shù)據(jù)庫(kù)用戶要有這些權(quán)限)    GateIn3.1假定你的數(shù)據(jù)庫(kù)編碼方式為latin1,你可能需要改變你的數(shù)據(jù)庫(kù)的編碼方式來(lái)讓Gate3.1正常工作 (注解:latin1 就是ISO8859-1編碼,這個(gè)好像是mySql常用的編碼方式,在我建立Oracle數(shù)據(jù)庫(kù)時(shí)并沒(méi)有這個(gè)編碼方式,我用的是UTF-8,這個(gè)是寬字符集,應(yīng)該是兼容的,反正到現(xiàn)在還沒(méi)發(fā)現(xiàn)有問(wèn)題)2.1.2. Configuring the database for JCR
        To configure the database used by JCR you will need to edit the file:

        $JBOSS_HOME/server/default/conf/gatein/configuration.propertiesFor Tomcat, the file is located at

        $TOMCAT_HOME/gatein/conf/configuration.propertiesAnd edit the values of driver, url, username and password with the values for your JDBC connection (please, refer to your database JDBC driver documentation).


        gatein.jcr.datasource.driver=org.hsqldb.jdbcDriver
        gatein.jcr.datasource.url=jdbc:hsqldb:file:${gatein.db.data.dir}/data/jdbcjcr_${name}
        gatein.jcr.datasource.username=sa
        gatein.jcr.datasource.password=
        By default, the name of the database is "jdbcjcr_${name}" - ${name} should be a part of the database name, as it is dynamically replaced by the name of the portal container extension (for instance, gatein-sample-portal.ear defines "sample-portal" as container name and the default portal defines "portal" as container name).

        In the case of HSQL the databases are created automatically. For any other database you will need to create a database named jdbcjcr_portal (and "jdbcjcr_sample-portal" if you have gatein-sample-portal.ear in $JBOSS_HOME/server/default/deploy - note that some databases don't accept '-' in the database name, so you may have to remove $JBOSS_HOME/server/default/deploy/gatein-sample-portal.ear)

        Make sure the user has rights to create tables on jdbcjcr_portal, and to update them as they will be automatically created during the first startup .

        Also add your database's JDBC driver into the classpath - you can put it in $JBOSS_HOME/server/default/lib (or $TOMCAT_HOME/lib, if you are running on Tomcat)

        MySQL example:

        Let's configure our JCR to store data in MySQL. Let's pretend we have a user named "gateinuser" with a password "gateinpassword". We would create a database "mygateindb_portal" (remember that _portal is required), and assign our user the rights to create tables.

        Then we need to add MySQL's JDBC driver to the classpath, and finally edit gatein.ear/02portal.war/WEB-INF/conf/jcr/jcr-configuration to contain the following:

        gatein.jcr.datasource.driver=com.mysql.jdbc.Driver
        gatein.jcr.datasource.url=jdbc:mysql://localhost:3306/mygateindb${container.name.suffix}
        gatein.jcr.datasource.username=gateinuser
        gatein.jcr.datasource.password=gateinpassword
        2.1.2. JCR的數(shù)據(jù)庫(kù)配置修改配置文件: JBOSS: $JBOSS_HOME/server/default/conf/gatein/configuration.propertiesTomcat:$TOMCAT_HOME/gatein/conf/configuration.properties修改其中的驅(qū)動(dòng),url,用戶名,密碼,例如:gatein.jcr.datasource.driver=org.hsqldb.jdbcDriver
        gatein.jcr.datasource.url=jdbc:hsqldb:file:${gatein.db.data.dir}/data/jdbcjcr_${name}
        gatein.jcr.datasource.username=sa
        gatein.jcr.datasource.password=

        ....略去說(shuō)它自已的默認(rèn)配置方式,重點(diǎn)在下一段里.....
        說(shuō)在數(shù)據(jù)庫(kù)為HSQL時(shí),Gatein會(huì)自動(dòng)的創(chuàng)建數(shù)據(jù)庫(kù),但是如果是別的那么要手動(dòng)的建立名為:"jdbcjcr_portal"的數(shù)據(jù)庫(kù)
        (注解:根據(jù)上一段所說(shuō),應(yīng)該是庫(kù)名必須為_(kāi)portal結(jié)尾,但是保險(xiǎn)起見(jiàn),我把我Oracle的全局?jǐn)?shù)據(jù)庫(kù)名創(chuàng)建為,jdbcjcr_portal,
        為這我還重裝了一次Oracle,不知道如果不改而只是創(chuàng)建一個(gè)名為jdbcjcr_portal的schema可以不可以,知道的試下告訴我一下吧)
        (還要?jiǎng)?chuàng)建一個(gè)名為"jdbcjcr_sample-portal"的數(shù)據(jù)庫(kù),為GateIn的一個(gè)例子使用,但是有些數(shù)據(jù)庫(kù)不支持"-"命名數(shù)據(jù)庫(kù),
        那么就把這個(gè)例子刪除,位置是$JBOSS_HOME/server/default/deploy/gatein-sample-portal.ear)
        (注解:我是直接干掉了這個(gè)ear的,簡(jiǎn)單方便)

        要確保你的數(shù)據(jù)庫(kù)用戶有建表的權(quán)限。要把你的數(shù)據(jù)庫(kù)驅(qū)動(dòng)考到$JBOSS_HOME/server/default/lib (你用Tomcat的話是$TOMCAT_HOME/lib)給出了一個(gè)mysql 的例子:gatein.jcr.datasource.driver=com.mysql.jdbc.Driver
        gatein.jcr.datasource.url=jdbc:mysql://localhost:3306/mygateindb${container.name.suffix}
        gatein.jcr.datasource.username=gateinuser
        gatein.jcr.datasource.password=gateinpassword
        我的
        gatein.jcr.config.type=local
        gatein.jcr.datasource.name=java:jdbcjcr
        gatein.jcr.datasource.dialect=auto
        gatein.jcr.datasource.driver=Oracle.jdbc.driver.OracleDriver
        gatein.jcr.datasource.url=jdbc:Oracle:thin:@192.168.0.200:1521:dgoral
        gatein.jcr.datasource.username=jdbcjcr_portal
        gatein.jcr.datasource.password=XXXX
        2.1.3. Configuring the database for the default identity store
        By default, users are stored in a database. To change the database in which to store users, you will need to edit the file:

        $JBOSS_HOME/server/default/conf/gatein/configuration.propertiesFor Tomcat, the file is located at

        $TOMCAT_HOME/gatein/conf/configuration.propertiesYou will find the same kind of configuration as in jcr-configuration.xml:

        gatein.idm.datasource.driver=org.hsqldb.jdbcDriver
        gatein.idm.datasource.url=jdbc:hsqldb:file:${gatein.db.data.dir}/data/jdbcidm_${name}
        gatein.idm.datasource.username=sa
        gatein.idm.datasource.password2.1.3. 配置身份認(rèn)證的數(shù)據(jù)庫(kù)還是上面的那個(gè)配置文件:JBOSS: $JBOSS_HOME/server/default/conf/gatein/configuration.propertiesTomcat:$TOMCAT_HOME/gatein/conf/configuration.properties例子:(注解:這個(gè)我和上面那個(gè)用的同一個(gè)庫(kù),粘帖下就行了)gatein.idm.datasource.driver=org.hsqldb.jdbcDriver
        gatein.idm.datasource.url=jdbc:hsqldb:file:${gatein.db.data.dir}/data/jdbcidm_${name}
        gatein.idm.datasource.username=sa
        gatein.idm.datasource.password
        我的
        # IDM
        gatein.idm.datasource.name=java:jdbcidm
        gatein.idm.datasource.driver=Oracle.jdbc.driver.OracleDriver
        gatein.idm.datasource.url=jdbc:Oracle:thin:@192.168.0.200:1521:dgoral
        gatein.idm.datasource.username=jdbcjcr_porta
        gatein.idm.datasource.password=XXXX

        看完上面的也就基本可以弄好了。多說(shuō)一點(diǎn),我對(duì)Oracle不是很了解,oracle的sid是不可以有“_“的,但是全局?jǐn)?shù)據(jù)庫(kù)名可以有,但是連接url中的部分還是要寫(xiě)sid的,寫(xiě)數(shù)據(jù)庫(kù)名是不行了,有了解oracle的請(qǐng)指點(diǎn)一下。


         


        本文出自:億恩科技【mszdt.com】

        服務(wù)器租用/服務(wù)器托管中國(guó)五強(qiáng)!虛擬主機(jī)域名注冊(cè)頂級(jí)提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]

      2. 您可能在找
      3. 億恩北京公司:
      4. 經(jīng)營(yíng)性ICP/ISP證:京B2-20150015
      5. 億恩鄭州公司:
      6. 經(jīng)營(yíng)性ICP/ISP/IDC證:豫B1.B2-20060070
      7. 億恩南昌公司:
      8. 經(jīng)營(yíng)性ICP/ISP證:贛B2-20080012
      9. 服務(wù)器/云主機(jī) 24小時(shí)售后服務(wù)電話:0371-60135900
      10. 虛擬主機(jī)/智能建站 24小時(shí)售后服務(wù)電話:0371-60135900
      11. 專注服務(wù)器托管17年
        掃掃關(guān)注-微信公眾號(hào)
        0371-60135900
        Copyright© 1999-2019 ENKJ All Rights Reserved 億恩科技 版權(quán)所有  地址:鄭州市高新區(qū)翠竹街1號(hào)總部企業(yè)基地億恩大廈  法律顧問(wèn):河南亞太人律師事務(wù)所郝建鋒、杜慧月律師   京公網(wǎng)安備41019702002023號(hào)
          0
         
         
         
         

        0371-60135900
        7*24小時(shí)客服服務(wù)熱線