Problems importing an OO database into LO

Try "Add File" (freely translated from my FR interface) first (point to the directory where your .jar lies) then, when back to the Class Path window, use "Add Archive". You should be set now.

Hi :slight_smile: I think that's a tad unfair. People have grown-up learning
MS's ways of doing things and so "intuitive" means doing things MS's
way, ie the ways that encourages a proliferation of viruses and
causes slowdowns and encourages bad-habits.

Intuitive? Hu. From Wikipedia: "Intuition is the ability to acquire knowledge without inference or the use of reason."

I do not know of *any* computer or computer program that can be run without inference or the use of reason.

Any time I hear "intuitive" within the IT context, I jump to a gun.

A blank page in a Writer document looks like it's going to be fairly
easy to write in and it is as long as people can avoid the bad habits
they have picked up and perhaps even quickly skim through some of the
official documentation or look things up in it if their first few
tries are not instantly successful

To do that, they need training. Much training. First to forget that a computer is no typewriter, then to change their (bad) habits.

Hi :slight_smile:
+1
I can definitely agree with this!  Well said! :slight_smile:
Regards from
Tom :slight_smile:

Hi Ian,

OK
Step 1. Done (I downloaded and extracted hsqldb 2.2.8 to my 'software'
folder)
Step 2. The lib folder is under root and all files are grey-ed out in
Class Path??

Why are you trying to put the jar in your root's lib folder, or are you
logged into the GUI as root ?

             I then looked at my 'software' folder and found it there.
             Tried to set 'Class Path' to this but again all files are
grey-ed out.

Did you change the permissions on that folder after downloading so that
it was accessible ? From what you describe, it sounds like you didn't.
Some systems do not automatically enable the execute bit attribute on
files that you download from the internet or is it perhaps your Software
folder that has write/execute limitations ? LO needs to be able to
access the jar file in a folder which it can read from.

            Did a search across my whole drive and found the following 3
files
            /home/ian/software/hsqldb-2.2.8/hsqldb/lib/hsqldb.jar

Check the permissions on your /software folder and also the permissions
on the hsqldb folder and any files in it. The jar file at least, needs
to have the executable bit set.

Alex

Am 20.04.2012 14:08, Mark Stanton wrote:

Hi Ian,

The easy version is :-

1) Open your database with the HSQLDB embedded data.
2) In a separate window, create a new database with any other kind of
    data engine.
3) Drag the tables from the embedded database to the new database,
    one by one.
4) Drag any other objects from the old database to the new one, too.

I'm guessing that the important bit that you need there is missed
out, the "how to create and link up to A.N.Other database".

Indeed, this is the easy version to copy anything (spreadsheet, csv, mail address, embedded HSQL, ...) into some writable target database.
This can not convert an embedded HSQLDB to an external one because once you point the office to the external HSQL the embedded won't be accessible anymore. I described how to extract the whole embedded thing out of the database.odb and use it directly with the external database.

For the above outlined copy&paste method I use to recommend that you should have prepared the target database.
Copying the structure and data in one go, as offered by the import wizard, never creates any auto-ID fields. The wizard can automatically add some integer key, but it is not the automatically incrementing one you need in most cases. Once the tables are filled with data it is difficult (impossible?) to change the primary key to be auto-incrementing.
However, if the auto-id is predefined you can import arbitrary integer data that fit to the related integers in other tables.

First create all the tables with default values, indices, primary keys, constraints and foreign keys (relations). Then copy over the raw data into the prepared structure and in the right order. Detail tables first, then the dependent data tables where the foreign keys refer to the detail tables.

Am 20.04.2012 16:48, Ian Whitfield wrote:

             /home/ian/software/hsqldb-2.2.8/hsqldb/lib/hsqldb.jar

menu:Tools>Options>Java
Button "Class Path"
Button "Add Archive" and point to the above one.

+1 - The only reason computers seem intuitive is that most OS's and programs use the ideas developed at PARC and first implemented in the 80's. Some of the command groupings are not necessarily intuitive. MSO ribbon to me is not very intuitive, I can spend more hunting down a command than with older interfaces.

OK - one step at a time I guess....

I checked the permissions on the three .jar files and found that the 'x' setting was not checked so I made them all wide-open. Now when I go to 'Class Path' I can "see" them and select one.

(BTW - except for the one I put in in my 'software' folder the other two must have been put there by LO). I selected the one in 'software' (ver 2.2.8 - hsqldb.jar)

As I now want to try the external-linked way of running Base I selected to "Create a New Database'. Base opens but says .....

a) I'm still using the embedded Database.
b) And I get an error box that says ... "The connection to the data source <DB Name> could not be established.
The driver class 'org.hsqldb.jdbcDriver' coud not be loaded. The additional driver class path is 'vnd.sun.star.expand:$BRAND_BASE_DIR/program/classes/hsqldb.jar
vnd.sun.star.expand:$BRAND_BASE_DIR/program/classes/sdbc_hsqldb.jar'.

Some more assistance please!!!

Hi Ian,

Check the permissions on your /software folder and also the permissions
on the hsqldb folder and any files in it. The jar file at least, needs
to have the executable bit set.

You only needed to check/change the permissions on this :

/home/ian/software/hsqldb-2.2.8/hsqldb/lib/hsqldb.jar

not the others ! Those other jar files you listed are the ones that come
with LO, and you shouldn't really be fiddling around with those.

As I now want to try the external-linked way of running Base I selected
to "Create a New Database'. Base opens but says .....

a) I'm still using the embedded Database.
b) And I get an error box that says ... "The connection to the data
source <DB Name> could not be established.
The driver class 'org.hsqldb.jdbcDriver' coud not be loaded. The
additional driver class path is
'vnd.sun.star.expand:$BRAND_BASE_DIR/program/classes/hsqldb.jar
vnd.sun.star.expand:$BRAND_BASE_DIR/program/classes/sdbc_hsqldb.jar'.

1) Remove the links that you added to the Classpath parameter to :
/opt/libreoffice3.5/programs/classes/hsqldb.jar
/opt/libreoffice3.5/programs/classes/sdbc_hsqldb.jar

LO already knows where to find them. From what you describe as your
actions, you added them again to the classpath, and that is
possibly/probably what is causing LO to moan.

2) After removing the links to those files, restart LO.

3) Do not open your old ODB file in LO Base yet, i.e. the one you want
to migrate over to using the hsqldb2 engine.

4) Follow Andreas' instructions from point (3) onwards :

3) Extract the database folder out of your embedded .odb.

What Andreas means here is that you should make a copy of your existing
ODB database file, then unzip the copy. Although one can work directly
on the original ODB file if you know what you are doing, it would be
better I think in this case to work on a copy of that file.

4) Rename the files:
properties, script, backup, data
to:
foo.properties, foo.script, foo.backup, foo.data
where "foo" is just an arbitrary name.

This instruction should be clear, if not, please state what you don't
understand

5) Connect a new Base document to a JDBC data source with an URL like:
jdbc:hsqldb:file:/path/to/extracted/database/foo;default_schema=true
(the "foo" refers to the same database name I used as file name prefix)

This too, seems clear to me, but if you have a question, please ask.

6) Copy queries, forms and reports from the old embedded .odb to the new one.

This too, seems clear to me, but again, if uncertain, please ask.

Alex

Thanks Alex..... but 'No Go' I'm afraid!!!

I ONLY added the ONE path to the class like you say but I removed it and re-started LO and did it again. After another re-start I STILL get the same error message when I try to start a new Database.

I'm working this way because Base screwed-up my original DB so badly (which is why I decided to make a change). The original .odb file is such a mess. In looking for an alternative I've been working with Kexi and spent days correcting and editing my table in this program. It's very good but I have discovered a few flaws - the main one being a TOTAL LACK of support!!!!

So my plan is to get Base working with the external HSQLDB2 engine, recreate my Table layout and then export my corrected table from Kexi in .csv format and import it into the new Base layout. Hope you follow me.

Thanks for the kind help.

In addition to what I wrote a couple of hours back - I have just tried a couple of other things...

I linked the class path to the two files mentioned in the Error Box. LO accepted both of them OK AND popped-up a box warning me to re-start LO and then worked fine. BUT both are linked to the embedded engine!!

I tried again with the 2.2.8 version and noticed I DO NOT get the warning box to re-start LO. And it gives me the error box as reported.

I then moved a copy of the .jre file to the same location as the first two and tried again - no change!!

This leaves me wondering if the .jre file is at fault. It's new, (I downloaded it yesterday), and is 1.4Mb in size??

Does this sound like a problem??

Am 21.04.2012 15:46, Ian Whitfield wrote:

This leaves me wondering if the .jre file is at fault. It's new, (I
downloaded it yesterday), and is 1.4Mb in size??

This is the md5sum of my working hsqldb-2.2.8.zip:
$ md5sum ~/download/hsqldb-2.2.8.zip
8b7668689cd208867c77f2f4d77922de /home/andreas/download/hsqldb-2.2.8.zip

My copy gives me the same Check-Sum!!

So what can be causing the problem??

Hi :slight_smile:
I almost hate to say it this late in the process but wouldn't a non-java back-end be better?  Java just seems to be a bit of a disaster these days, since Oracle took over.  Kexi uses Sqllite and there are surely other light back-ends that might be good to try?
Regards from
Tom :slight_smile:

Copying the structure and data in one go, as offered by the import
wizard, never creates any auto-ID fields.

Would this be a sensible improvement to make?

Mark Stanton
One small step for mankind...

Am 21.04.2012 18:58, Mark Stanton wrote:

Copying the structure and data in one go, as offered by the import
wizard, never creates any auto-ID fields.

Would this be a sensible improvement to make?

Mark Stanton
One small step for mankind...

Hello Mark,

Yes, it would be useful to have more import options that actually work when importing a pseudo-database (mostly spreadsheet lists) into a true database or into HSQLDB at least:
[X] Use first column as column name
[X] Create primary key [Name Box]
   [ ] Create primary key as auto-ID

And another exclusive option:
[o] Use existing column <list box> as auto-ID
[ ] Use existing column(s) <multi-select list box> as primary key

When importing from a true database into another true database, these options should be preset according to the situation in the source table but still modifyable. Sometimes you want to import with no constraints at all.

My above statement

... never creates any auto-ID fields.

is not entirely correct. At least a copy&paste between 2 HSQLDBs creates the integer PK as auto-ID. It creates an exact copy of the table. Some level of detection seems to be implemented already.
Copying from HSQLDB to H2 (a similar Java DB) does creates an integer PK but not as an auto-ID field.

I think it can be very hard to implement for all types of connectable database engines. There are UNO interfaces to detect the capabilities and idiosyncrasies of some database driver. May be this can be utilized, may be not.

to Andreas Säger <villeroy@t-online.de>

Hallo Andreas,

thank you for your short practical guide how to use a .dbf for serial letters.
I spent a lot of time fiddling around reading books etc. and couldnt come up
with a result. With your advice LO did what I want within some minutes. I
never understood what .odb is for: Its a simple container for a table etc.

so long

Walther

I'm a little despondent - over a week since I started this exercise and I'm still nowhere. Also 3 days since my last post and no suggestions.

Can anyone help me out??

I stand at the point of having HSQLDB2.2.8 on my computer but when I try to create a new DB I get a "cannot load driver error" (see previous posts). Is it that you CAN'T CREATE a new Database this way?? )I can't believe this). Or what am I doing wrong??

I _HAVE_ to crack this urgently and need some more help from some of you experts out there.

What I need to do - Set-up HSQLDB2 (Done); Link to it (fail); Create a new table layout (pending); import my data via .csv (pending). START WORK AGAIN (urgent)!!!

Thanks a lot.

What is the name of your database?
Answer:

     What folder are you going to use to hold the data?
Answer:

     What is the path to this folder?

Answer:

     Do you have the problems corrected the data in the database
already?

Answer:

     Is is this still the path to hsqldb?
Tools >Options > LibreOffice > Java > Class Path

Answer:

     With this information, I think someone will be able to help you
since these are the things you need to know to use hsqldb 2.2.8 as the
backend and Base as the front end.

--Dan

Walther Koehler wrote

to Andreas Säger &lt;villeroy@&gt;

Hallo Andreas,

thank you for your short practical guide how to use a .dbf for serial
letters.
I spent a lot of time fiddling around reading books etc. and couldnt come
up
with a result. With your advice LO did what I want within some minutes. I
never understood what .odb is for: Its a simple container for a table etc.

so long

Walther

Walter, I think you refer to another topic:
http://nabble.documentfoundation.org/database-td3926217i20.html#a3928210
This mail belongs to thread "Problems importing an OO database into LO by
ptoye "

I'm sorry to disagree. Except for the "embedded HSQLDB" type of database,
Bases files do not contain any tables.
You always _connect_ some Base file to some database, spreadsheet, csv file,
to the address book of some email application. Then you can see the tables
of the connected data source. The tables are in some other file or
directory. In case of dBase you connect a Base document to a directory of
.dbf files. When you edit the data in the Base document or in Writer's data
source window, the connected .dbf file(s) will be modified, the Base
document remains untouched.
Normally you create the data source with some other software and connect a
Base document to it in order to user these data in office documents. The
status bar indicates the type and the location of the connected data source.
When Base creates a new database with new tables from scratch, the .odb file
carries the data source in the .odb. The status bar shows "embedded HSQLDB".
This topic deals with this embedded HSQLDB, why it should not be used
(except for demos and learning stuff), how to get such a database out of the
.odb so it can be used as an external database with better database
software, why Base never reached the status of a mature database
application, why it is extremely useful anyway, how to use Base in in other
ways than documented ...