public class LocalJcrDriver extends Object implements Driver
The driver accepts the following URL format for accessing a local JCR repository using JNDI:
jdbc:jcr:jndi:{jndiName}or
jdbc:jcr:jndi:{jndiName}?{firstProperty}&{secondProperty}&...where
Repository
or org.modeshape.jcr.api.Repositories
instance can be found;
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%20WorkspaceThe "repository" property is required only if the object in JNDI is a org.modeshape.jcr.api.Repositories object.
Note that any use of URL encoding ('%' followed by a two-digit hexadecimal value) will be decoded before being used.
Modifier and Type | Class and Description |
---|---|
static interface |
LocalJcrDriver.JcrContextFactory
And interface that can be passed to this driver's constructor to create the JNDI naming context given the set of connection
properties.
|
Modifier and Type | Field and Description |
---|---|
protected static Set<String> |
ALL_PROPERTY_NAMES |
static String |
JNDI_URL_PREFIX |
protected static Logger |
logger |
static String |
PASSWORD_PROPERTY_NAME |
static String |
REPOSITORY_PROPERTY_NAME |
static String |
TEIID_SUPPORT_PROPERTY_NAME |
static String |
USERNAME_PROPERTY_NAME |
static String |
WORKSPACE_PROPERTY_NAME |
Modifier | Constructor and Description |
---|---|
|
LocalJcrDriver()
No-arg constructor, required by the
DriverManager . |
protected |
LocalJcrDriver(LocalJcrDriver.JcrContextFactory namingContextFactory)
Create an instance of this driver using the supplied JNDI naming context factory.
|
protected |
LocalJcrDriver(RepositoryDelegateFactory delegateFactory,
DriverInfo driverInfo,
LocalJcrDriver.JcrContextFactory namingContextFactory)
Constructor for subclasses, that should be called by subclasses no-arg constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptsURL(String url) |
Connection |
connect(String url,
Properties info)
Note that if the supplied properties and URL contain properties with the same name, the value from the supplied Properties
object will take precedence.
|
protected ConnectionInfo |
createConnectionInfo(String url,
Properties info)
Get the information describing the connection.
|
protected DriverInfo |
getDriverInfo() |
int |
getMajorVersion() |
int |
getMinorVersion() |
Logger |
getParentLogger()
This method always throws
SQLFeatureNotSupportedException . |
DriverPropertyInfo[] |
getPropertyInfo(String url,
Properties info) |
String |
getVendorName() |
String |
getVendorUrl() |
String |
getVersion() |
boolean |
jdbcCompliant() |
protected static Logger logger
public static final String WORKSPACE_PROPERTY_NAME
public static final String REPOSITORY_PROPERTY_NAME
public static final String USERNAME_PROPERTY_NAME
public static final String PASSWORD_PROPERTY_NAME
public static final String TEIID_SUPPORT_PROPERTY_NAME
public static final String JNDI_URL_PREFIX
public LocalJcrDriver()
DriverManager
.protected LocalJcrDriver(LocalJcrDriver.JcrContextFactory namingContextFactory)
namingContextFactory
- the naming context factory; may be null if one should be created automaticallyprotected LocalJcrDriver(RepositoryDelegateFactory delegateFactory, DriverInfo driverInfo, LocalJcrDriver.JcrContextFactory namingContextFactory)
delegateFactory
- the factory that should be used to create RepositoryDelegate
instances; may not be nulldriverInfo
- the information about the driver; may not be nullnamingContextFactory
- the naming context factory; may be null if one should be created automaticallypublic boolean acceptsURL(String url)
acceptsURL
in interface Driver
public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException
getPropertyInfo
in interface Driver
SQLException
protected ConnectionInfo createConnectionInfo(String url, Properties info) throws SQLException
ConnectionInfo
that implements ConnectionInfo.getCredentials()
for a specific JCR implementation.url
- the JDBC URLinfo
- the JDBC connection propertiesSQLException
public Connection connect(String url, Properties info) throws SQLException
Note that if the supplied properties and URL contain properties with the same name, the value from the supplied Properties object will take precedence.
connect
in interface Driver
SQLException
Driver.connect(java.lang.String, java.util.Properties)
public int getMajorVersion()
getMajorVersion
in interface Driver
public int getMinorVersion()
getMinorVersion
in interface Driver
public String getVendorName()
public String getVendorUrl()
public String getVersion()
public boolean jdbcCompliant()
jdbcCompliant
in interface Driver
protected final DriverInfo getDriverInfo()
public Logger getParentLogger() throws SQLFeatureNotSupportedException
SQLFeatureNotSupportedException
.
Note: This method is part of the JDBC API in JDK 1.7.
getParentLogger
in interface Driver
SQLFeatureNotSupportedException
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.