Adding database user access to the persistence type

You can add user access to the ruleset repository if the persistence type is set to database mode.

About this task

You can add user access rights to the persistence type previously set up for a ruleset in the persistenceProperties configuration property of the deployment descriptor. The default value is a data source on Java™ SE. You can change this value to a different data source or to file persistence.

Procedure

To add database user access to the ruleset repository:

  1. Open the RAR deployment descriptor in any text or XML editor.
  2. Locate the property name <config-property-name>persistenceProperties</config-property-name>.
    <config-property>
       <config-property-name>persistenceProperties</config-property-name>
       <config-property-type>java.lang.String</config-property-type>
       <config-property-value>JNDI_NAME=jdbc/resdatasource,XOM_PERSISTENCE_TYPE=datasource,XOM_PERSISTENCE_JNDI_NAME=jdbc/resdatasource</config-property-value>
    </config-property>

    The first parameter JNDI_NAME=jdbc/resdatasource is for the ruleset repository. The default value specifies database persistence in Java SE, with the JNDI name as jdbc/resdatasource. The provider does not use the USER and PASSWORD properties in this case. The XOM_PERSISTENCE_<> values are for the XOM repository if you have set up Java XOM management for the ruleset. You can change those values as explained in Changing the Java XOM persistence type.

  3. On the <config-property-value> line, replace the default value of the first parameter with the value of your database and user:
    <config-property-value>
       DRIVER_CLASS_NAME=org.apache.derby.jdbc.EmbeddedDriver,
       URL=jdbc:derby:resdb;create=true,
       USER=res,
       PASSWORD=res
    </config-property-value>

    Where:

    • DRIVER_CLASS_NAME is a driver implementation class to establish a connection with the database.
    • URL is the JDBC URL to establish a connection with the database.
    • USER is the login to use with the database connection.
    • PASSWORD is a password to use with the database connection.
  4. Save the deployment descriptor.
  5. Restart the application server.