Can I replace the embedded version of HSQLDB with the current version?

From Apache OpenOffice Wiki
Jump to: navigation, search


Can I replace the embedded version of HSQLDB with the current version?


In a word, no. Simply replacing the included HSQLDB.jar file with a current one will not work. However a newer version of HSQLDB can be installed and Base can connect to it using the JDBC driver. To do that, download (https://sourceforge.net/projects/hsqldb/files/) and install the latest version of HSQLDB.

Then locate the HSQLDB.jar file, which will likely be inside the hsqldb\lib directory, relative to the install location. Add this location to the global class path setting in OpenOffice. (From any application: Tools → Options → OpenOffice → Java, then click on 'Class Path…', then 'Add Archive…' and enter the full path to the file.)

Documentation caution.png This can lead to a serious 'gotcha'! See below for details and for how to specify the path an alternate way.

An HSQLDB database can then be created by using the OpenOffice Database Wizard. Select "Connect to an existing database" (even though it doesn't exist yet) and select the JDBC driver, then click on  NEXT >> .

For 'datasource:' specify "jdbc:hsqldb:file:<path>;shutdown=true;default_schema=true;hsqldb.default_table_type=cached;get_column_name=false", where <path> is location to store the database files. The path can include a filename without an extension. For 'driver class:', specify "org.hsqldb.jdbc.JDBCDriver". Then complete the wizard to create a .odb file for this database connection.

More information about the actual database files that will be created is available here (https://hsqldb.org/doc/2.0/guide/runningchapt.html#rgc_hsqldb_db) .

More information about the connection properties specified in the datasource URL is available here (https://hsqldb.org/doc/2.0/guide/dbproperties-chapt.html#dpc_connection_props).

Personal tools