Library is readonly (Extension FreeHSQLDB-0)

Discuss the database features
Post Reply
CmdrBalok
Posts: 2
Joined: Sat Jul 05, 2014 7:20 pm

Library is readonly (Extension FreeHSQLDB-0)

Post by CmdrBalok »

 Edit: Split from [Solved] Tracing SQL Commands because that topic is solved so you need your own. If you had the same problem you could use the same solution. Please do not post in another's topic unless you are helping to solve their problem for them. 
0) Make a backup copy of your embedded database.
1) Download the latest HSQLDB and extract it somewhere. Mine is in /usr/local/lib/ or C:\Program Files\ or something. No further installation required.
2) Unzip the database folder out of the odb and rename all files (sript, data, properties) adding some common name prefix (prefix.script, prefix.data, prefix.properties).
3) Download d ... p?id=17008, do NOT extract but install it via Tools>Extensions...[Add...]. It dumps a Basic library FreeHSQLDB into your user profile.
4) Open your odb and call Tools>Macros>Organize>Basic>MyMacros>FreeHSQLDB>FreeHSQLDB>Main which pops up a dialog.
5) Point the tool to lib/hsqldb.jar extracted in step 1).
6) Point the tool to the *.script file extracted and renamed in 2).
7) Save your *.odb, notice the new connection indicated on the status bar and see if your database works as it used to when it was embedded.
It is years later but I found this in a search for how to split off a database, so that I could try to upgrade HSQLDB, since what ships with LibreOffice seems to lack many features of SQL. Including 'WITH', the one I specifically want to experiment with here. I get an error that the library is readonly and I am not sure why.

Specifically:
Sub SaveDefaultClassPath(sJDCP)
Dim sLine$, oLib
REM Modify module "StoreClassPath"
sLine = "Public Const cClassPath = """& sJDCP &""""
oLib = GlobalScope.BasicLibraries.getByName("FreeHSQLDB")
oLib.replaceByName("StoreClassPath", sLine)
End Sub

The call to replaceByName(...) is what fails. I noticed, as well, that the extension added FreeHSQLDB to 'LibreOffice Macros' and not to 'My Macros'. It did that automatically. Maybe this extension does not work with LibreOffice, or not with version 7+?

If anyone sees this and knows how to correct this problem I would be grateful to learn. Thanks.
OO 4.0.0, Win7 HP SP1 64-bit
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Library is readonly (Extension FreeHSQLDB-0)

Post by Villeroy »

Comment out that line (if you can). It is just stores the last used path for convenience. The rest should work read-only.
Oh, and don't use the latest HSQL version. 2.4.x is the last one which is able to convert HSQL 1.8 (the embedded). 2.5.x is the last one which cooperates perfectly with LibreOffice. The latest versions 2.6.x include some changes in the user groups managements which are not compatible with LibreOffice.
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