<commit_before># jdbc-jcr

[![Build Status](https://api.travis-ci.org/woonsan/jdbc-jcr.svg?branch=master)](https://api.travis-ci.org/woonsan/jdbc-jcr.svg?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/woonsan/jdbc-jcr/badge.svg?branch=develop)](https://coveralls.io/github/woonsan/jdbc-jcr?branch=develop)
[![Maven Central](https://img.shields.io/maven-central/v/com.github.woonsan/jdbc-jcr.svg)](http://mvnrepository.com/artifact/com.github.woonsan/jdbc-jcr)

JDBC Driver for JCR Repository

# Introduction

**jdbc-jcr** provides a JDBC Driver for JCR Repository using JCR2_SQL query language.

# How to Add this module in my Project

Add the following dependency:

```xml
            <dependency>
                <groupId>com.github.woonsan</groupId>
                <artifactId>jdbc-jcr</artifactId>
                <version>${jdbc-jcr.version}</version>
            </dependency>
```

# JDBC URLs

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)

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
for more details.
The fourth one (with an empty location and repository parameters) is to create a TransientRepository.

# Example to Create Connection

```java
        private Connection getConnection() throws SQLException {
            Properties info = new Properties();
            info.setProperty("username", "admin");
            info.setProperty("password", "<PASSWORD>");

            final String jdbcUrl = "jdbc:jcr:http://localhost:8080/server/";
            Driver jdbcDriver = new com.github.woonsan.jdbc.jcr.Driver.Driver();
            Connection conn = jdbcDriver.connect(jdbcUrl, info);
            return conn;
        }
```

# Example with Statement

```java
        //<commit_msg>updating travis-ci badge<commit_after># jdbc-jcr

[![Build Status](https://travis-ci.org/woonsan/jdbc-jcr.svg?branch=develop)](https://travis-ci.org/woonsan/jdbc-jcr)
[![Coverage Status](https://coveralls.io/repos/github/woonsan/jdbc-jcr/badge.svg?branch=develop)](https://coveralls.io/github/woonsan/jdbc-jcr?branch=develop)
[![Maven Central](https://img.shields.io/maven-central/v/com.github.woonsan/jdbc-jcr.svg)](http://mvnrepository.com/artifact/com.github.woonsan/jdbc-jcr)

JDBC Driver for JCR Repository

# Introduction

**jdbc-jcr** provides a JDBC Driver for JCR Repository using JCR2_SQL query language.

# How to Add this module in my Project

Add the following dependency:

```xml
            <dependency>
                <groupId>com.github.woonsan</groupId>
                <artifactId>jdbc-jcr</artifactId>
                <version>${jdbc-jcr.version}</version>
            </dependency>
```

# JDBC URLs

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)

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
for more details.
The fourth one (with an empty location and repository parameters) is to create a TransientRepository.

# Example to create JDBC Connection

```java
        private Connection getConnection() throws SQLException {
            Properties info = new Properties();
            info.setProperty("username", "admin");
            info.setProperty("password", "<PASSWORD>");

            final String jdbcUrl = "jdbc:jcr:http://localhost:8080/server/";
            Driver jdbcDriver = new com.github.woonsan.jdbc.jcr.Driver.Driver();
            Connection conn = jdbcDriver.connect(jdbcUrl, info);
            return conn;
        }
```

# Example with Statement

```java
        //
{'fraction_non_alphanumeric': 0.13475650433622416, 'fraction_numerical': 0.004447409384033801, 'mean_word_length': 3.418467583497053, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '154553', 'n_tokens_mistral': 1477, 'n_tokens_neox': 1360, 'n_words': 339}