Connections

In the connections configuration you can specify how to connect to the data sources. Connections configuration can be found in PENROSE_HOME/conf/sources.xml.

<sources>

  <connection name="...">

    <adapter-name>...</adapter-name>

    <parameter>
        <param-name>...</param-name>
        <param-value>...</param-value>
    </parameter>

  </connection>

</sources>

Name

Assign a name to your connections. This name will be used in creating sources.

Adapter Name

Specify the name of the adapter you want to use.

Parameters

Specify the connection parameters.

JDBC Parameters

Parameter Description Example
driver JDBC Driver class name com.mysql.jdbc.Driver
url JDBC URL jdbc:mysql://localhost/penrose_demo?autoReconnect=true
user Username sa
password Password secret

JNDI Parameters

Parameter Description Example
java.naming.factory.initial Initial context factory com.sun.jndi.ldap.LdapCtxFactory
java.naming.provider.url URL ldap://localhost/dc=penrose,dc=safehaus,dc=org
java.naming.security.principal Principal cn=Directory Manager
java.naming.security.credentials Password secret

Database Connection Example

<connection name="MySQL">

  <adapter-name>JDBC</adapter-name>

  <parameter>
    <param-name>user</param-name>
    <param-value>sa</param-value>
  </parameter>

  <parameter>
    <param-name>password</param-name>
    <param-value>secret</param-value>
  </parameter>

  <parameter>
    <param-name>url</param-name>
    <param-value>jdbc:mysql://localhost/penrose_demo?autoReconnect=true</param-value>
  </parameter>

  <parameter>
    <param-name>driver</param-name>
    <param-value>com.mysql.jdbc.Driver</param-value>
  </parameter>

</connection>

LDAP Connection Example

<connection name="SunONE">

  <adapter-name>JNDI</adapter-name>

  <parameter>
    <param-name>java.naming.provider.url</param-name>
    <param-value>ldap://localhost/dc=penrose,dc=safehaus,dc=org</param-value>
  </parameter>

  <parameter>
    <param-name>java.naming.factory.initial</param-name>
    <param-value>com.sun.jndi.ldap.LdapCtxFactory</param-value>
  </parameter>

  <parameter>
    <param-name>java.naming.security.principal</param-name>
    <param-value>cn=Directory Manager</param-value>
  </parameter>

  <parameter>
    <param-name>java.naming.security.credentials</param-name>
    <param-value>secret</param-value>
  </parameter>

</connection>