SQL on JSON


Лицензия

Лицензия

Категории

Категории

JSON Данные
Группа

Группа

com.github.terma
Идентификатор

Идентификатор

sql-on-json
Последняя версия

Последняя версия

2.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

SQL on JSON
SQL on JSON
Ссылка на сайт

Ссылка на сайт

https://github.com/terma/sql-on-json
Система контроля версий

Система контроля версий

https://github.com/terma/sql-on-json

Скачать sql-on-json

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.terma/sql-on-json/ -->
<dependency>
    <groupId>com.github.terma</groupId>
    <artifactId>sql-on-json</artifactId>
    <version>2.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.terma/sql-on-json/
implementation 'com.github.terma:sql-on-json:2.0.0'
// https://jarcasting.com/artifacts/com.github.terma/sql-on-json/
implementation ("com.github.terma:sql-on-json:2.0.0")
'com.github.terma:sql-on-json:jar:2.0.0'
<dependency org="com.github.terma" name="sql-on-json" rev="2.0.0">
  <artifact name="sql-on-json" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.terma', module='sql-on-json', version='2.0.0')
)
libraryDependencies += "com.github.terma" % "sql-on-json" % "2.0.0"
[com.github.terma/sql-on-json "2.0.0"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
com.google.code.gson : gson jar 2.3.1
org.apache.commons : commons-lang3 jar 3.5
org.hsqldb : hsqldb jar 2.3.5

test (2)

Идентификатор библиотеки Тип Версия
com.h2database : h2 jar 1.4.195
junit : junit jar 4.10

Модули Проекта

Данный проект не имеет модулей.

sql-on-json

Build Status Maven Central

How to use

try (Connection c = new SqlOnJson().convertPlain("{a:[{id:12000,name:\"super\"},{id:90,name:\"remta\"}]}")) {
    ResultSet rs = c.prepareStatement("select * from a").executeQuery();
    while (rs.next()) {
        // my business logic
    }
}

Use non default DB

By default sql-on-json uses HSQLDB

final SqlOnJson sqlOnJson = new SqlOnJson("driver-class", "url", "user", "password");
try (Connection c = sqlOnJson.convertPlain("{a:[{id:12000,name:\"super\"},{id:90,name:\"remta\"}]}")) {
    ...
}

For example you can use H2

final SqlOnJson sqlOnJson = new SqlOnJson("org.h2.Driver", "jdbc:h2:mem:", "", "");
try (...)

To make DB URL unique per new SqlOnJson(...) you can use placeholder <INSTANCE_ID> in second parameter of constructor url, for HSQLDB it will be jdbc:hsqldb:mem:sql_on_json_<INSTANCE_ID>;shutdown=true

Версии библиотеки

Версия
2.0.0
1.0.1
1.0.0
0.0.4
0.0.3
0.0.2