Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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:

1. 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.
2. 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.

Nested Class Summary

Nested classes/interfaces inherited from class org.modeshape.jdbc.LocalJcrDriver
`LocalJcrDriver.JcrContextFactory`

Field Summary
`static String` | `HTTP_URL_PREFIX`

Fields inherited from class org.modeshape.jdbc.LocalJcrDriver
`ALL_PROPERTY_NAMES, JNDI_URL_PREFIX, logger, PASSWORD_PROPERTY_NAME, REPOSITORY_PROPERTY_NAME, TEIID_SUPPORT_PROPERTY_NAME, USERNAME_PROPERTY_NAME, WORKSPACE_PROPERTY_NAME`

Constructor Summary
`JcrDriver()` No-arg constructor, required by the `DriverManager`.
`JcrDriver(LocalJcrDriver.JcrContextFactory namingContextFactory)` Create an instance of this driver using the supplied JNDI naming context factory.

Method Summary
`static JcrDriver` | `getInstance()`

Methods inherited from class org.modeshape.jdbc.LocalJcrDriver
`acceptsURL, connect, createConnectionInfo, getDriverInfo, getMajorVersion, getMinorVersion, getPropertyInfo, getVendorName, getVendorUrl, getVersion, jdbcCompliant`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### HTTP_URL_PREFIX

    public static final String HTTP_URL_PREFIX

See Also:
  Constant Field Values

Constructor Detail

### JcrDriver

    public JcrDriver()

  No-arg constructor, required by the `DriverManager`.

### JcrDriver

    public 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

Method Detail

### getInstance

    public static JcrDriver getInstance()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008-2011 JBoss, a division of Red Hat. All Rights Reserved.