Apache Jackrabbit : UsingJNDIDataSource

How to use a JNDI DataSource

Jackrabbit supports JNDI data sources. The bundle database persistence manager, the database data store, and the file system (including its subclasses) support a JNDI data source in place of the JDBC driver and database URL. Here is how you can configure those two using data sources:

<FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
  <param name="driver" value="javax.naming.InitialContext"/>
  <param name="url" value="java:comp/env/jdbc/DataStore"/>
</FileSystem>
<DataStore class="org.apache.jackrabbit.core.data.db.DbDataStore">
  <param name="driver" value="javax.naming.InitialContext"/>
  <param name="url" value="java:comp/env/jdbc/DataStore"/>
  <param name="databaseType" value="postgresql"/>
</DataStore>
<PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.PostgreSQLPersistenceManager">
  <param name="driver" value="javax.naming.InitialContext"/>
  <param name="url" value="java:comp/env/jdbc/Workspaces"/>
  <param name="schemaObjectPrefix" value="${wsp.name}_"/>
  <param name="schema" value="postgresql"/>
</PersistenceManager>

Please note that 'schema' in the persistence manager has the meaning of 'database type'.