Base v7.2 Split Database Problems - JavaDriverClassPath Not Working As Expected

Copied the latest Split Database code from Download Split Database Code and installed it ok
The code runs ok, but produces errors

I fixed the source directory problem arising from the change of “Title” handling

Remaining PROBLEM is that LibreOffice does not find the “custom” class path. By setting breakoints and watch lists I can see that “ThisDatabaseDocument.DataSource.Settings.JavaDriverClassPath” is being set in the same manner as the code in FreeHSQLDB routines, so it looks correct BUT the database cannot be opened (spurious message about UNIQUE keyword in the “script” file).

If I go to Tools/Options/Advanced/ClassPath and add the archive (hsqldb.jar) then the database opens - but not exactly portable

Is it possible that the object model has changed in V7.2 ?

Have I missed something ?

I am grateful for any advice

Remove hsqldb.jar from the Office class path.
Restart office.
Use FreeHSQLDB v.0.3 (View topic) • Apache OpenOffice Community Forum
(install extension, open database document, call macro, add paths for database and driver).

Did you ever run that database with HSQL2 or is it an extracted HSQLDB 1,8?
Try to point FreeHSQL at <office_install_path>/program/classes/hsqldb.jar Does this open your database.
Which version of HSQL2 are you trying to use? Any version >2.4.x is not compatible with HSQL1.8. You have to download HSQL2,3 or 2.4 to open and convert 1.8. Then you may replace that version with the latest.
Avoiid all special characters in paths. The conversion from system paths to URLs is not perfect.

Yes, good point.
I had tried opening a couple of instances with both 1.8 and 2.4 … which probably led to corruption (even though they’re very simple databases - only 2 tables)
I’ve now modified the Macro to derive the filename properly (and add “name” to Title) and re-created the database tables from a backup
All working ok now - including transportability

Thanks for your help :slight_smile:

When you open an embedded HSQLDB 1.8 while the class path points to HSQL2 (version before 2.5), the embedded database will be converted on the fly and becomes unusable as an embedded database. The only way to regain access to this database is extract and reconnect.
You can manually extract the database folder and add a filename prefix to the contained files.
script → mydb.script
propertiees → mydb.script
etc.

Hello,

The problem is caused by the title missing in the Base screens - tdf#144329.
.
You can either go back to a previous LO version or apply the code noted here → Unable to edit field info after saving new table

Edit: I should note that the affected macro is in Standard>Embedded>Setup

Umm … I fixed that …
added code to correctly evaluate the directory structure (on Linux - Ubuntu 18.04 with LO PPA) which is working correctly

for iLen = len(sPath) to 1 step -1
	if mid(sPath,iLen,1) = "/" then
		exit for
	endif
next iLen
sName = Right(sPath, Len(sPath) - iLen)

checked the directory and URL and “sName” etc. all look good. But jar file still not found although the database is found as expected and can opened

Tested twice tonight - once with my code and once with yours. Both worked.

I am using TDF version:

Version: 7.2.2.2 / LibreOffice Community
Build ID: 02b2acce88a210515b4a5bb2e46cbfb63fe97d56
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

On Ubuntu 20.04.3 Mate

Really do not think the version or OS is the issue. But not certain of your problem. I can get your error if I Rem this line:

    sPath = ConvertFromURL(sPathURL)

Then I get:

Screenshot at 2021-10-18 21-45-52

Otherwise I can move all to a different location and it still works.

thanks for looking at this

I don’t have that line in my version of the code, I have

sClassPath = ConvertToURL(sClassPath)

I’ve tried with and without that and both fail ie. both of these fail (dir form and URL form)

/home/user/Documents/libreoffice/application/libreoffice_application_hsqldb_2_2/driver/hsqldb.jar
file:///home/user/Documents/libreoffice/application/libreoffice_application_hsqldb_2_2/driver/hsqldb.jar

Do I need to issue some kind of “execute” or “update” to force a reload ?

Any other thoughts ?

Some progress

I started to wonder if I had a path sequence issue so reviewed all class paths defined to LO. There were 2, one for sqlite and one for “ucanaccess”. Guess what, “ucanaccess” includes an hsql jar !

So removed the errant classpath and created a new database using the “split database” template (after applying my code fix)
NOW I can open a new database !

Existing DBs are still borked tho. Perhaps changes in hsql driver version has borked them, keep seeing these errors

BTW how do I attach an image (screenshot say) ?

thanks again