Documentation for Crowd 1.2. Documentation for other versions of Crowd is available too.

To connect Crowd to Oracle,

1. Oracle の設定

  1. Create a database user which Crowd will connect as (e.g. crowduser).
  2. Create a database for Crowd to store data in (e.g. crowddb).
  3. Ensure that the user has permission to connect to the database, and create and populate tables

2. Copy the Oracle driver to your application server

  1. Download the Oracle JDBC driver from http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html.
  2. Add the Oracle JDBC driver jar to the apache-tomcat-X.X.XX/common/lib directory.

3. Configure your application server to connect to Oracle

  1. Edit the file apache-tomcat-X.X.XX/conf/Catalina/localhost/crowd.xml and customise the username, password, driverClassName and url parameters for the Datasource.
    <Context path="/crowd" docBase="../../crowd-webapp" debug="0">
    
        <Resource name="jdbc/CrowdDS" auth="Container" type="javax.sql.DataSource"
                  username="[enter db username here]"
                  password="[enter db password here]"
                  driverClassName="oracle.jdbc.driver.OracleDriver"
                  url="jdbc:oracle:thin:@localhost:1521:crowdb"
                  [ delete the minEvictableIdleTimeMillis, timeBetweenEvictionRunsMillis and maxActive params here ]
                />
    
        <Manager className="org.apache.catalina.session.PersistentManager" saveOnRestart="false"/>
    
    </Context>
    
  2. Delete the minEvictableIdleTimeMillis, timeBetweenEvictionRunsMillis and maxActive attributes (which are only needed for HSQL, and degrade performance otherwise).

4. Configure Crowd to use Oracle

  1. Edit the build.properties file (located in the root of the standalone release) and modify the hibernate.dialect to the following
    *For Oracle 10g set:*
    hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
    *For Oracle 9i set:*
    hibernate.dialect=org.hibernate.dialect.Oracle9iDialect
    *For Oracle 8i set:*
    hibernate.dialect=org.hibernate.dialect.Oracle8iDialect
    
  2. Then run ./build.sh or build.bat. This will configure crowd to use the Oracle dialect. (warning) There is a problem with build.bat in Crowd version 1.2.0. To fix the problem, please apply the patch described in CWD-638.

If you do not wish to edit this file and run the build script, you can edit the jdbc.properties (which the above script modifies) directly. The jdbc.properties file is located here: crowd-webapp\WEB-INF\classes\jdbc.properties. Modify the file to the following:

# - Crowd Configuration Options

hibernate.connection.datasource=java\:comp/env/jdbc/CrowdDS
hibernate.dialect=org.hibernate.dialect.OracleDialect
hibernate.transaction.factory_class=org.hibernate.transaction.JDBCTransactionFactory

...

次のステップ

You should now have an application server configured to connect to a database, and Crowd configured to use the correct database. Now start up Crowd and watch the logs for any errors.

関連トピック