The driver class org.hsqldb.jdbcDriver could not be established

Discuss the database features
Post Reply
Nocton
Volunteer
Posts: 543
Joined: Fri Nov 05, 2010 10:27 am
Location: UK

The driver class org.hsqldb.jdbcDriver could not be established

Post by Nocton »

Following an email with security warning from OO I upgraded from 4.1.16 to 4.1.17. Now when I open a Writer labels document linked to my address database I get the error:
"The driver class org.hsqldb.jdbcDriver could not be established"

The Base application works OK as far as I can see. The Writer doc is linked to a View table in the database which opens OK from Base.
My search engine is hsqldb.jar.

Help please - It must be something simple I imagine.
.
OpenOffice 4.1.16 on Windows 10 & 11
F3K Total
Volunteer
Posts: 1051
Joined: Fri Dec 16, 2011 8:20 pm

Re: The driver class org.hsqldb.jdbcDriver could not be established

Post by F3K Total »

Is it a Split db?
https://bugs.documentfoundation.org/sho ... ?id=174296
Maybe this problem?
  • MMove 1.0.6
  • Extension for easy, exact positioning of shapes, pictures, controls, frames ...
  • my current system
  • Windows 11 AOO, LO | Linux Mint AOO, LO
Nocton
Volunteer
Posts: 543
Joined: Fri Nov 05, 2010 10:27 am
Location: UK

Re: The driver class org.hsqldb.jdbcDriver could not be established

Post by Nocton »

Yes, it is a split db, but the link you give refers to LO and I am using OO. There are some small differences between LO and OO Base, and my database gives one or two problems with LO.
OpenOffice 4.1.16 on Windows 10 & 11
User avatar
Villeroy
Volunteer
Posts: 31366
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: The driver class org.hsqldb.jdbcDriver could not be established

Post by Villeroy »

I think they broke the same thing in OpenOffice as they did in LibreOffice for obscure security reasons. Open your database document and any object therein. Just loading the Base file does not establish the connection. You should get the same error message. Reverting to 4.1.16 should not harm since the active development of AOO stopped anyway.

The following 3 macros try to fix some issues with the recent version of LibreOffice.
Enter your Path on top of the module in system notation like "C:\Path\hsqldb.jar" and assign the right macro to the "Open Document" event.
- fix_174926 reconnects the current Base document with the JDBC driver specified by const cJarPath.
- fix_174926_Writer_Form tries to do the same for a stand-alone Writer document with forms.
- fix_174926_MailMerge does the trick with a mail merge document.

Code: Select all

REM  *****  BASIC  *****
Const cJarPath = "/opt/hsql/hsqldb-2.4.1/hsqldb/lib/hsqldb.jar"

Sub fix_174926()
oDoc = ThisComponent ' this code is not embedded in the odb
on error goto Not_Embedded
	oDoc = ThisDatabaseComponent ' this code is embedded in the odb
on error goto No_ODB:
oSettings = oDoc.DataSource.Settings
oSettings.JavaDriverClassPath = ConvertToURL(cJarPath)
exit sub
Not_Embedded:
	resume next
No_ODB:
	Msgbox "No ODB doc", 16
End Sub

Sub fix_174926_Writer_Form()
	oDrawPage = ThisComponent.DrawPage
	oForm = oDrawPage.Forms.getByIndex(0)
	sDB = oForm.DataSourceName
	oDBCtx = createUnoService("com.sun.star.sdb.DatabaseContext")
	oReg = oDBCtx.getByName(sDB)
	oDatabaseDocument = oReg.DatabaseDocument
	oDataSource = oDatabaseDocument.DataSource
	oSettings = oDataSource.Settings
	oSettings.JavaDriverClassPath = ConvertToURL(cJarPath)
End Sub

REM com.sun.star.text.fieldmaster.DataBase.MyDatabaseName.Filtered_Report.FN
Sub fix_174926_MailMerge()
tfm = ThisComponent.TextFieldMasters
a() = tfm.getElementNames()
iUB = uBound(a())
	for i = 0 to iUB
		s = a(i)
		b() = split(s, ".")
		if b(5) = "DataBase." then
			sDB = b(6)
			exit for
		endif
	next
	if i > iUB then exit sub
	oDBCtx = createUnoService("com.sun.star.sdb.DatabaseContext")
	oReg = oDBCtx.getByName(sDB)
	oDatabaseDocument = oReg.DatabaseDocument
	oDataSource = oDatabaseDocument.DataSource
	oSettings = oDataSource.Settings
	oSettings.JavaDriverClassPath = ConvertToURL(cJarPath)
End Sub
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
Nocton
Volunteer
Posts: 543
Joined: Fri Nov 05, 2010 10:27 am
Location: UK

Re: The driver class org.hsqldb.jdbcDriver could not be established

Post by Nocton »

Thank you, Villeroy. As you said "Reverting to 4.1.16 should not harm", I have simply done that and all works OK again.
I would not normally update software for a minor update as here, but as there was a security warning I decided to do so. But why aren't such fixes properly tested and thought about? It turns out not to be a minor update at all.
OpenOffice 4.1.16 on Windows 10 & 11
User avatar
RoryOF
Moderator
Posts: 35269
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: The driver class org.hsqldb.jdbcDriver could not be established

Post by RoryOF »

I don't do databases as I live a very simple life! However, the links in this topic may be of assistance

https://ask.libreoffice.org/t/office-li ... ded/139598
Apache OpenOffice 4.1.17 on Xubuntu 26.04.1 LTS
Nocton
Volunteer
Posts: 543
Joined: Fri Nov 05, 2010 10:27 am
Location: UK

Re: The driver class org.hsqldb.jdbcDriver could not be established

Post by Nocton »

Yes, it is the same problem in LO. At 84, I am not doing anything with databases now, but just using a couple I wrote years ago, so it is very annoying when problems like this crop up.
OpenOffice 4.1.16 on Windows 10 & 11
Post Reply