|
Splitting an ODB File
From NeoWiki
By default NeoOffice uses the embedded HSQL 1.8 database engine when creating a odb file. This is fine for quick development, but it can cause problems data loss problems if NeoOffice crashes and it makes it hard to deploy updated forms and reports to the user if you are developing a database for someone else. By splitting the database from the odb file the HSQL databse engine runs as a separate process and is unaffected inthe event of a NeoOffice crash.
This page is based on posting on the oooForum, specifically this page [1].
Setting up NeoOffice
Start NeoOffice
Select NeoOffice -> Preferences -> NeoOffice -> Java
Click on Class Path…
Click on Add Archive…
Type Shift-Cmd-G
Enter the path /Applications/NeoOffice.app/Contents/basis-link/program/classes/ and click Go(N.B. you can type the first few letter of each folder name and press TAB to speed things up).
Select the file hsqldb.jar and click and click Open.
Click OK to get rid of all the dialogue boxes and restart NeoOffice.
Testing it works
Download the file mydb.odb
Create a folder in your Users folder called public/databases/mydb/
Copy the mydb.odb file into this folder.
Open the mydb.odb file
It is an empty database. Add some tables to it. You should see several new files appear in the mydb folder that the mydb.odb file is in.
Splitting you databse
This section is based on this post on the oooForum.
Make a copy of your odb file (from now on we will call the database <dbname> so the odb file is called <dbname>.odb, so if your database is called fred.db then all occurences of <dbname> should be replaced with fred.)
Drag the copy of the database to the folder /users/public/databases/<dbname>
Make sure it is called <dbname>.odb
Make another copy of this file and change the extension to .zip
Extract the files (using BOM Archive Helper or Stuffit Expander). There should now be a folder call <dbname> or <dbname> Folder
Double click this folder and then on the folder database
Rename the files in this folder by pre-pending the name of your database and a period. ie backup becomes <dbname>.backup, data <dbname>/data, etc.
Copy these renamed files back down the folder hierarchy to the <dbname> folder with the .odb file in it.
Rename the odb file old<dbname>.odb
In NeoOffice select File->New->Database
Select Connect to an Existing Database and select JDBC. Click Next
In the Data Source URL box enter: hsqldb:file:/users/public/databases/<dbname>/<dbname>;default_schema=true;shutdown=true;hsqldb.default_table_type=cached;get_column_name=false
In the JDBC driver class box enter: org.hsqldb.jdbcDriver (NB there must not be a space at the end of this string)
Click Next
Enter SA as the username
Click Next
Select to register the database and open it for editing.
Save the file as <dbname>.odb in the /users/public/databases/<dbname> folder
You should now have a databse with no Queries, Form or Reports. However all of your tables should be visible.