OOBase Wizard to connect to an existing db

Discuss the database features
Post Reply
1gatomontes
Posts: 20
Joined: Sun May 14, 2017 3:48 am

OOBase Wizard to connect to an existing db

Post by 1gatomontes »

CONTEXT:

This database we are trying to connect to was created using the default wizard from OpenOffice Base.
Then, it was 'split', by following the steps detailed by DACM (viewtopic.php?f=83&t=65980).

TEST:

We tried accessing this db on the local host, using the wizard:
Untitled1.jpg
Fill up the fields of step 2:
Untitled2.jpg
Test the connection in step 3:
Untitled3.jpg
Decide how to proceed in step 4 (keep the default selections, i.e. register the db and open for editing).

QUESTIONS (3) :

The first question comes when we click the 'Finish' button and a 'Save As' window opens up:
Why are we 'saving' this db? We don't understand the logic behind this.

The second question comes after saving the db:
Why are the tables the only objects available? Why aren't the forms, queries, and reports objects available?

The second question is triggered by the fact that if we simply open the db by double-clicking the odb file, all objects are available (i.e. tables, forms, queries, and reports).

The third question:
We want to use the wizard to access the db because, as far as we know, this is the only way to connect to a db running on a remote host, in server mode, for multiple users.
Or is there a better way?

Thanks again for your support and patience!
Windows 10
OpenOffice 4.1.3
HSQLDB 2.3.2
OpenOffice 4.1.2
Windows 10 (v.1607)
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: OOBase Wizard to connect to an existing db

Post by Villeroy »

A file connection to a hsqldb looks like this:
jdbc:hsqldb:file:/path/MyDB;default_schema=true;shutdown=true;hsqldb.default_table_type=cached;get_column_name=false

From left to right:
It is a jdbc connection
to a hsqldb
we use file access. The file path should be written in normal system notation with no URL encoding, e.g. with Windows backslashes C:\path\MyDB
MyDB is the name prefix of the database files (MyDB.script, MyDB.data, MyDB.properties and others)
The additional arguments after the semicolon are useful for a "normal" Base connection.
All the URL parts are pretty well documented in the HSQL documentation. This has absolutely nothing to do with the office suite.
In the same dialog you specify the JDBC driver class: org.hsqldb.jdbcDriver
You can fill in the URL in menu:Edit>Database>Properties... for an existing database frontend.
The wizard will always create a new empty database, connected to the database but with no queries, forms, reports.
What you can NOT do in the GUI can be done with XML editing or with a one-line macro to be run from anywhere in "My Macros"

Code: Select all

ThisComponent.DataSource.Settings.JavaDriverClassPath = ConvertToURL("path\to\hsqldb.jar")
Fill in the right path to your hsqldb.jar. If you want to run it from a Basic module embedded in the database document, replace ThisComponent with ThisDatabaseDocument.
Any jdbc driver other than hsql can be specified in the Java options [Class path], but if you add your hsqldb.jar to the global office class path, all embedded HSQL will be converted to HSQL2 and when you reload the embedded database, it will not work anymore until you extract it from the Base container. You can do that if you never open any document with embedded HSQL. The above code specifies a hsqldb.jar for the document alone and leaving alone the driver for the embedded databases.

I wrote a little GUI for all this: viewtopic.php?f=21&t=77543
-------------------------------------------------
A server connection to a hsqldb looks like this:
jdbc:hsqldb:hsql:Server/MyDB;default_schema=true;shutdown=true;hsqldb.default_table_type=cached;get_column_name=false
with hsql: instead of file: and with a server name or IP address instead of the path.
MyDB is name specified in the server configuration.
On the server machine a HSQL server runs as an independent program waiting for connections from clients. This is the mode you need for simultanious multi-user access.
Set up a hsql server on Windows: https://yarlagaddasuresh.wordpress.com/ ... s-service/
On a normal operating system: viewtopic.php?f=13&t=91740&p=435115#p435115 (oh, that was your thread. did it work for you?)
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
Post Reply