Create a new 'split' HSQL 2.x database

Discuss the database features
Post Reply
User avatar
Agilar
Posts: 85
Joined: Mon Oct 04, 2010 6:51 pm

Create a new 'split' HSQL 2.x database

Post by Agilar »

Does not work in LIbreOffice 5.3.1.2 on Kubuntu 17.04: I get

Code: Select all

Error 380: Incorrect property value. (line : 17)
(see attached screenshot)
Attachments
169.png
LibreOffice 4.1.2.3 on Kubuntu 14.04
User avatar
Hagar Delest
Moderator
Posts: 32657
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Create a new 'split' HSQL 2.x database

Post by Hagar Delest »

LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Create a new 'split' HSQL 2.x database

Post by Villeroy »

Close all documents
menu:Tools>Options>Java (LibreOffice: "Advanced" instead of "Java")
[Class Path ...]
Add archive hsqldb.jar wherever it resides.
Restart office.
DO NOT OPEN ANY EMBEDDED HSQLDB FOR NOW. It will be converted to HSQL2 and then it won't be usable unless you extract it
File>New>Database...
[X] Connect to existing database
Type: JDBC
URL: jdbc:hsqldb:file:/path/database/foo;default_schema=true;shutdown=true;hsqldb.default_table_type=cached;get_column_name=false
Driver class: org.hsqldb.jdbcDriver
[OK]
Click the table section to establish the connection with a new set of database files whose names start with foo. No tables created so far.

Notice that the red path should be written in system notation which is unusual for an URL, e.g. on Windows: jdbc:hsqldb:file:C:\path\database\foo. The blue part of the URL is a set of useful options for Base connected to HSQL.

Run the following macro after adjusting the driver path in the macro code (URL notation). The macro stores the path do the database driver within the Base document. This option is not availlable in the Base GUI.

Code: Select all

Sub setDriverPath()
ThisDatabaseDocument.DataSource.Settings.JavaDriverClassPath = "file:///path/to/hsqldb.jar"
End Sub
Save the database document.
Remove the global class path you have added in the first step and restart the office. The new database knows its own path to its hsqldb.jar and you should remove the global class path in order to be able to use embedded HSQL without spoiling them.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Create a new 'split' HSQL 2.x database

Post by Villeroy »

Of course, it is easier to start with an embedded HSQLDB and then run a script like this one or a little GUI tool like FreeHSQLDB
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply