I use an HSQLDB environment when my ivy Application is tested with Selenium Unit tests. The HSQLDB driver which is packed with ivy is the outdated version 1.8. With this version the concat() and group_concat() SQL functions are not (correctly) implemented and therefore some SQL statements can not be executed.

I tried to use HSQLDB 2.3.2 by adding the jar jre/lib/ext folder and selecting the driver "other" within the "Databases Configuration Editor". But if I do that the Designer can no longer be started as the System-DB of the Designer relies on HSLDB 1.8.

Is there any way to use a newer HSQLDB in my test environment?

asked 15.09.2014 at 16:12

SupportIvyTeam's gravatar image

SupportIvyTeam ♦♦
1.4k102118122
accept rate: 77%

edited 16.09.2014 at 09:08

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
9.4k31958


9.1 and later

HSQLDB is upgraded to 2.5.0.

8.0 and prior

You can use a repacked JAR that contains a newer HSQLDB and put it on the system classpath.

I've already prepared such a repacked JAR. You can download it here: HSQLDB 2.3.2 Repack

Configure your database as follows to use this repacked version:

  1. put the repack JAR into JRE/lib/ext folder of your designer
  2. chose the driver "Others" > "Other" within the Database Connection Configuration
  3. set the Driver Class to: org.hsqldb232.jdbc.JDBCDriver
  4. set the Connection URL to: jdbc:hsqldb232:mem

DB Editor with repacked HSQLDB

link

answered 15.09.2014 at 16:24

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
9.4k31958
accept rate: 70%

edited 06.04.2020 at 03:18

Alex%20Suter's gravatar image

Alex Suter ♦♦
3.1k122247

If you want to create a repacked version of HSQLDB by your own (may be to pack a newer version) proceed as follows:

  1. Create a repack JAR as described on repackage.org. E.g. trough JarJar.

    • Move all classes from org.hsqldb into a new Package like org.hsldb234
  2. Adjust the java.sql.Driver service

    • Extract the file META-INF/services/java.sql.Driver from the repacked JAR
    • Open it in a Text-Editor and adjust the full qualified name of the JDBCDriver implementation so that it matches your new package structure. E.g. org.hslqdb234.jdbc.JDBCDriver
    • Put the manipulated service file back into the JAR (e.g by Overwriting the content with 7-ZIP)
  3. Change the JDBC URL to avoid conflicts with other versions that work with the same URL

    • Extract the file org/hsqldb234/DatabaseURL.class from the repacked JAR
    • Open this class in the Java Class File Editor
    • Switch into class modification mode (upper right corner)
    • Change the JDBC connection URL in the field S_URL_PREFIX to a similar URL as the repacked namespace. E.g. jdbc:hsqldb234
    • Save the manipulated DatabaseURL.class file
    • Put the manipulated class file back into the JAR (e.g by Overwriting the content with 7-ZIP)
  4. Done! Use the manipulated JAR trough your own custom JDBC URL(e.g. jdbc:hsqldb234)

alt text

link

answered 15.09.2014 at 16:38

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
9.4k31958
accept rate: 70%

edited 16.09.2014 at 09:05

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×8

Asked: 15.09.2014 at 16:12

Seen: 3,752 times

Last updated: 06.04.2020 at 03:18