|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.modeshape.jdbc.JcrDriver
public class JcrDriver
A JDBC driver implementation that is able to access a JCR repository to query its contents using JCR-SQL2.
The driver accepts several URL formats based on how the repository is configured:
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.
jdbc:jcr:http://{hostname}:{port}?{firstProperty}&{secondProperty}&...where
Repository
or org.modeshape.jcr.api.Repositories instance can be found;Repository
or org.modeshape.jcr.api.Repositories on the specified hostname;
Nested Class Summary | |
---|---|
static interface |
JcrDriver.JcrContextFactory
|
Field Summary | |
---|---|
protected static Set<String> |
ALL_PROPERTY_NAMES
|
JcrDriver.JcrContextFactory |
contextFactory
|
static String |
HTTP_URL_PREFIX
|
static String |
JNDI_URL_PREFIX
|
protected static Logger |
logger
|
static String |
PASSWORD_PROPERTY_NAME
|
static String |
REPOSITORY_PROPERTY_NAME
|
static String |
USERNAME_PROPERTY_NAME
|
static String |
WORKSPACE_PROPERTY_NAME
|
Constructor Summary | |
---|---|
JcrDriver()
No-arg constructor, required by the DriverManager . |
Method Summary | |
---|---|
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. |
static JcrDriver |
getInstance()
|
int |
getMajorVersion()
|
int |
getMinorVersion()
|
DriverPropertyInfo[] |
getPropertyInfo(String url,
Properties info)
|
String |
getVendorName()
|
String |
getVendorUrl()
|
String |
getVersion()
|
boolean |
jdbcCompliant()
|
void |
setContextFactory(JcrDriver.JcrContextFactory factory)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
protected static final Set<String> ALL_PROPERTY_NAMES
public static final String JNDI_URL_PREFIX
public static final String HTTP_URL_PREFIX
public JcrDriver.JcrContextFactory contextFactory
Constructor Detail |
---|
public JcrDriver()
DriverManager
.
Method Detail |
---|
public static JcrDriver getInstance()
public boolean acceptsURL(String url)
acceptsURL
in interface Driver
Driver.acceptsURL(java.lang.String)
public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException
getPropertyInfo
in interface Driver
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 properties
SQLException
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.
SQLException
Driver.connect(java.lang.String, java.util.Properties)
public int getMajorVersion()
getMajorVersion
in interface Driver
Driver.getMajorVersion()
public int getMinorVersion()
getMinorVersion
in interface Driver
Driver.getMinorVersion()
public String getVendorName()
public String getVendorUrl()
public String getVersion()
public boolean jdbcCompliant()
jdbcCompliant
in interface Driver
Driver.jdbcCompliant()
public void setContextFactory(JcrDriver.JcrContextFactory factory)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |