org.modeshape.jdbc
Class JcrDriver
java.lang.Object
org.modeshape.jdbc.LocalJcrDriver
org.modeshape.jdbc.JcrDriver
- All Implemented Interfaces:
- Driver
public class JcrDriver
- extends LocalJcrDriver
A JDBC driver implementation that is able to access a JCR repository to query its contents using JCR-SQL2.
Connection URLs
The driver accepts several URL formats based on how the repository is configured:
- configured for local access using JNDI
jdbc:jcr:jndi:{jndiName}
or
jdbc:jcr:jndi:{jndiName}?{firstProperty}&{secondProperty}&...
where
- {jndiName} is the JNDI name where the
Repository
or org.modeshape.jcr.api.Repositories
instance can be found;
- {firstProperty} consists of the first property name followed by '=' followed by the property's value;
- {secondProperty} consists of the second property name followed by '=' followed by the property's value;
Note that any use of URL encoding ('%' followed by a two-digit hexadecimal value) will be decoded before being used.
Here's an example of a URL that defines a Repository
instance located at "jcr/local
" with a repository
name of "repository" and a user, password of "secret", and workspace name of "My Workspace":
jdbc:jcr:jndi:jcr/local?repositoryName=repository&user=jsmith&password=secret&workspace=My%20Workspace
The "repository" property is required only if the object in JNDI is a org.modeshape.jcr.api.Repositories object.
- configured for remote access using REST interface.
jdbc:jcr:http://{hostname}:{port}?{firstProperty}&{secondProperty}&...
where
- {hostname} is the host name where the
Repository
or org.modeshape.jcr.api.Repositories
instance can be found;
- {port} is the port to access the
Repository
or org.modeshape.jcr.api.Repositories on
the specified hostname;
- {firstProperty} consists of the first property name followed by '=' followed by the property's value;
- {secondProperty} consists of the second property name followed by '=' followed by the property's value;
Note that any use of URL encoding ('%' followed by a two-digit hexadecimal value) will be decoded before being used.
Methods inherited from class org.modeshape.jdbc.LocalJcrDriver |
acceptsURL, connect, createConnectionInfo, getDriverInfo, getMajorVersion, getMinorVersion, getParentLogger, getPropertyInfo, getVendorName, getVendorUrl, getVersion, jdbcCompliant |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HTTP_URL_PREFIX
public static final String HTTP_URL_PREFIX
- See Also:
- Constant Field Values
JcrDriver
protected JcrDriver(LocalJcrDriver.JcrContextFactory namingContextFactory)
- Create an instance of this driver using the supplied JNDI naming context factory. This is useful for testing, but is
otherwise not generally recommended.
- Parameters:
namingContextFactory
- the naming context factory; may be null if one should be created automatically
Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.