Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
woonsan committed Mar 10, 2016
1 parent f1375ff commit 58012d7
Showing 1 changed file with 27 additions and 11 deletions.
38 changes: 27 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ Add the following dependency:

# JDBC URLs

JDBC URLs using this drivers must start with 'jdbc:jcr:'.
JDBC URLs using this drivers must start with ```jdbc:jcr:```.
The following JDBC URLs are supported:

- **jdbc:jcr:http(s)://...** (e.g, jdbc:jcr:http://localhost:8080/server/)
- **jdbc:jcr:file://...**
- **jdbc:jcr:jndi:...**
- **jdbc:jcr:** (e.g, jdbc:jcr:?repository.conf=repository.xml&repository.home=repository)
- ```jdbc:jcr:http(s)://...``` (e.g, ```jdbc:jcr:http://localhost:8080/server/```)
- ```jdbc:jcr:file://...```
- ```jdbc:jcr:jndi:...```
- ```jdbc:jcr:``` (e.g, ```jdbc:jcr:?repository.conf=repository.xml&repository.home=repository```)

The first one is to create a remote repository connection using SPI2DAVex with the given URL.
The first one is to create a remote repository connection using ```SPI2DAVex``` with the given URL.
The second one is to create an embedded Jackrabbit repository located in the given directory.
The third one is to lookup JNDI for the named repository. See the org.apache.jackrabbit.commons.JndiRepositoryFactory
The third one is to lookup JNDI for the named repository. See the ```org.apache.jackrabbit.commons.JndiRepositoryFactory```
for more details.
The fourth one (with an empty location and repository parameters) is to create a TransientRepository.
The fourth one (with an empty location and repository parameters) is to create a ```TransientRepository```.

# Example to create JDBC Connection
# Example to create JDBC ```Connection```

```java
private Connection getConnection() throws SQLException {
Expand All @@ -53,7 +53,23 @@ The fourth one (with an empty location and repository parameters) is to create a
}
```

# Example with Statement
# Example to define JNDI ```DataSource``` resource

It assumes there is a JNDI resource (```jcr/repository```) as ```javax.jcr.Repository```.

```xml
<Resource name="jdbc/jcr"
auth="Container"
type="javax.sql.DataSource"
username="liveusername"
password="liveuserpass"
driverClassName="com.github.woonsan.jdbc.jcr.Driver"
url="jdbc:jcr:jndi:java:comp/env/jcr/repository"
maxActive="20"
maxIdle="10"/>
```

# Example with ```Statement```

```java
//
Expand Down Expand Up @@ -111,7 +127,7 @@ The fourth one (with an empty location and repository parameters) is to create a
}
```

# Example with PreparedStatement
# Example with ```PreparedStatement```

```java
final String sql2 =
Expand Down

0 comments on commit 58012d7

Please sign in to comment.