Skip to content

Commit 40484a5

Browse files
committed
Rollback H2 to HSQL for back compatibility
1 parent 151a127 commit 40484a5

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

pom.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,6 @@
9494
</build>
9595

9696
<dependencies>
97-
<dependency>
98-
<groupId>com.h2database</groupId>
99-
<artifactId>h2</artifactId>
100-
<version>1.4.195</version>
101-
</dependency>
102-
10397
<dependency>
10498
<groupId>com.google.code.gson</groupId>
10599
<artifactId>gson</artifactId>
@@ -116,6 +110,12 @@
116110
<groupId>org.hsqldb</groupId>
117111
<artifactId>hsqldb</artifactId>
118112
<version>2.3.5</version>
113+
</dependency>
114+
115+
<dependency>
116+
<groupId>com.h2database</groupId>
117+
<artifactId>h2</artifactId>
118+
<version>1.4.195</version>
119119
<scope>test</scope>
120120
</dependency>
121121

src/main/java/com/github/terma/sqlonjson/SqlOnJson.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ public class SqlOnJson {
4646

4747
public static final String INSTANCE_ID_PLACEHOLDER = "<INSTANCE_ID>";
4848

49-
public static final String DEFAULT_DRIVER = "org.h2.Driver";
50-
public static final String DEFAULT_URL = "jdbc:h2:mem:";
51-
public static final String DEFAULT_USERNAME = "";
49+
public static final String DEFAULT_DRIVER = "org.hsqldb.jdbc.JDBCDriver";
50+
public static final String DEFAULT_URL = "jdbc:hsqldb:mem:sql_on_json_" + INSTANCE_ID_PLACEHOLDER + ";shutdown=true";
51+
public static final String DEFAULT_USERNAME = "sa";
5252
public static final String DEFAULT_PASSWORD = "";
5353

5454
private static final Logger LOGGER = Logger.getLogger(SqlOnJson.class.getName());

src/test/java/com/github/terma/sqlonjson/SqlOnJsonTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public void supportRenamingOfColumnsForDefaultDb() throws Exception {
204204

205205
@Test
206206
public void supportCustomDb() throws Exception {
207-
try (Connection c = new SqlOnJson("org.hsqldb.jdbc.JDBCDriver", "jdbc:hsqldb:mem:sql_on_json_test;shutdown=true", "sa", "")
207+
try (Connection c = new SqlOnJson("org.h2.Driver", "jdbc:h2:mem:", "", "")
208208
.convertPlain("{orders:[{user_id:13,id:900}],users:[{id:13}]}")) {
209209
ResultSet rs1 = c.prepareStatement("select o.id as oid, u.id as uid from orders o left join users u on user_id = u.id").executeQuery();
210210
rs1.next();

0 commit comments

Comments
 (0)