Skip to main content

Connecting to HyperSQL with OpenOffice.org

For those of you who wished for a 'user-friendly' graphical interface for a HyperSQL database, your wait is over! OpenOffice.org Base is the preferred graphical environment for a HyperSQL database as OOo actually utilises HyperSQL as its embedded database engine.

Here's what you'll need:

And here's how to get it up and running:

1. Extract the downloaded HyperSQL bundle to a location on your local machine, e.g. C:\hsqldb-1.8.0.10
[optional]: Add the following entries to your system environment variables:
  • name: HSQLDB_HOME value: <path to your HyperSQL installation, e.g. C:\hsqldb-1.8.0.10>
  • name: PATH value: ;%HSQLDB_HOME%\lib; Note: This value should be added to your existing PATH value!

2. Install OpenOffice.org.

3. Configure OpenOffice.org's Java classpath. 
Open the OpenOffice.org launch pad dialog (on Windows: Start > Programs > OpenOffice.org X.X > OpenOffice.org).
Add your HyperSQL installation to the OpenOffice.org classpath settings: Tools > Options... > OpenOffice.org > Java and click on the Class Path... button (see below):

Click on Add Archive... and/or Add Folder buttons and add the hsqldb.jar and servlet.jar archives located in your HyperSQL \lib directory to OpenOffice.org's classpath settings.
You'll need to restart OpenOffice.org for the changes to take effect. Make sure to check in your taskbar (or in Windows Task Manager) for the OpenOffice.org QuickStarter Applet (look for an icon with little birds on it), otherwise OpenOffice.org won't exit fully.

4. Start the HyperSQL database server. 
Refer to the HyperSQL documentation (see: http://hsqldb.org/web/hsqlFAQ.html) or simply run the following command:
java -cp <path to your hsqldb.jar> org.hsqldb.Server -database.0 file:<path to your database .script file> -dbname.0 <database alias to use>
e.g.: java -cp C:\\hsqldb-1.8.0.10\\lib\\hsqldb.jar org.hsqldb.Server -database.0 file:C:\\Temp\\fndres\\resdb -dbname.0 resdb
Note: If the specified database instance doesn't exist, HyperSQL should generate a new instance for you. I've also outlined a convenient procedure for starting/stopping an HyperSQL database server is a previous post (see here).

5. Open a database connection.
Open OpenOffice.org Base and select Connect to existing database, then choose JDBC. Set the database connection parameters as follows:
Datasource URL: jdbc:hsqldb:hsql:<database url>;default_schema=true
JDBC driver class: org.hsqldb.jdbcDriver
User name: <database user>
where:
  • Database URL: refers to the URL of your database, e.g. //localhost/resdb. Note: The 'jdbc' protion of the Datasource URL is prefilled for you.
  • Database User: This is the database user accound to that OpeOffice.org should connect as, e.g. sa.
Once finished, you should be able to view/edit the database ina  similar fashion to Microsoft Access.

For more information, you can refer to the HyperSQL documentation here: http://hsqldb.org/doc/2.0/guide/openoffice-app.html

M.

Comments

Popular posts from this blog

Windows 7 Printer Registry

Here's today's annoyance: Adding a new network printer to Windows 7 failed to update the Windows registry properly. At work the other day I needed to add a new network printer. Pretty easy huh? After browsing for the network device, installing the correct driver and running of a test page I thought I was done. Apparently I was mistaken. Here's what happened after the printer was added: Applications such as Adobe Reader X fail to "see" the added printer. Applications such as Microsoft Word 2010 or Excel 2010 can "see" the printer (kinda) but will not let you select it. Could not set and/or change the default printer, fails with " Operation could not be completed (error 0x00000709). Double check the printer name and make sure that printer is connected to the network. ". Thinking there was something wrong with the network, printer driver and/or ports I (attempted to) uninstall/re-install the printer several times - ending up with severa...

Why Me?

Well, here we are, another new year and yet another new blogger. Sigh. Don’t get me wrong, I don’t have anything against blogs - I totally get the point of blogging, I really do! - it’s just that I’m not a journal type of guy. I’m notoriously slack at posting or even returning correspondence on any of these social networking sites. Years have been known to pass before I might get around to letting Bob (not his real name) know that “ yes, I do think that Beck’s is a great beer ”. So why the hell am I writing a blog I hear you ask? Well, 2011 has brought a reasonably significant event in my life: I’m moving. More specifically I’ve left my current job with Company I and will be starting a new job with Company A (not their real names either). I’m also selling my house and moving 832km with my wife and four children from Wollongong, NSW to Melbourne, VIC . Well, slight correction: hopefully selling my house, we haven’t had any offers just yet... so it looks very likely that I’ll be movi...