Java Forms Connecting to Base

Creating and using forms
Post Reply
DenisCamargo
Posts: 2
Joined: Wed Jul 01, 2009 9:26 pm

Java Forms Connecting to Base

Post by DenisCamargo »

Hi,

I am developing a database for my workplace, and we use OOo, as the company adopted OpenOffice (signed the http://www.softwarelivre.gov.br/protoco ... o-brasilia).

I dislike the way the forms open with all these Writer toolbars, menus and window decorations around. Most of them are disabled or useless anyway.

So, I would like to try and put some Java Swing forms to run with my Base DB, but I need some pointers to get me started.

I want to embed the Java into the ODB document. It could be called from within the OOo window, and run from there connecting via the xScriptContext arg.

I would like to know:

1) Can I put the database file in a shared network folder, and have several users open it to work, or does the ODB document gets locked like text and spreadsheets? How robust is the document handling in this concurrent multi-access scenario?

2) Do I have to get the DB driver running in Java like other database applications, or should I use UNO API calls to manipulate the data?

Maybe there are more questions as this develops, but for start that is good enough.

Also, if someone has an example database file with embedded Java macros, it would be great. I searched and found nothing.
OOo 3.1.X on Debian + Win XP, Ubuntu
User avatar
r4zoli
Volunteer
Posts: 2882
Joined: Mon Nov 19, 2007 8:23 pm
Location: Budapest, Hungary

Re: Java Forms Connecting to Base

Post by r4zoli »

Your problem which you can face based on that, OOo Base odb file designed as one file one user.
You can use OOo as front end to any real database server, and it can be a HSQLDB stand alone server.

The form can be programmed in such way when all menus and toolbars, one example for this is a Switchboard extension.
Roberto Benitez's Form programming document.
AOO 4.0 and LibO 4 on Win 8
Hungarian forum co-admin
DenisCamargo
Posts: 2
Joined: Wed Jul 01, 2009 9:26 pm

Re: Java Forms Connecting to Base

Post by DenisCamargo »

I believe this is an issue that will plague Base for a long time. It will get compared with MS Access at every single corner. Access allows concurrent use of a DB file, I thought Base did it too.

Gonna check out these links, be back in a couple days to post here my findings. If it is positive, write off something for the future generations and mark solved.
OOo 3.1.X on Debian + Win XP, Ubuntu
MikeDay
Posts: 1
Joined: Sun Dec 13, 2009 2:15 pm

Re: Java Forms Connecting to Base

Post by MikeDay »

I see the Switchboard as a rudimentary solution to presenting the user with a form-only (no BASE window, menu, or toolbars)

But my question goes back to Denis's original post. Assuming a programmer spends a week or two learning the OOo macros and API, he can provide the user a form with only the menu items the user needs. (and none of the BASE toolbars or menu items a database designer uses) Right? :?:

I ask because I am new to OOffice and assessing its capabilities. I want to use BASE and Calc feeding (mailmerge, I suppose) into a Writer output, where users use BASE forms as their data entry and see Writer documents (PDF) as output, and the user operates primarily in a menu of BASE forms.
OOo 3.1, WinXP
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Java Forms Connecting to Base

Post by Villeroy »

Do not waste your time. The original poster "Java Forms Connecting to Base" is not aware that the underlying HSQLDB is a database engine for Java programmers. The database itself is written in Java. You can install HSQLDB as separate server app and write your Java forms completely without any office suite. Base is not a database program you can connect to. It is a frontend which itself connects to databases. The embedded HSQL is just a special type of connection which needs to be extracted before connecting to it.

Base has almost nothing in common with Access. It is exactly what the greedy crowd begged for. But nobody uses it since it is not good enough.
You waste your time when you try to squeeze more out of it by means of Basic macros. I'm convinced that this is a mission impossible. Basic macros do not help to get more users with functional databases.
Base is excellent when you need to import external data in office documents. The report builder meets rather professional requirements. You create your database in some professional tool and use Base as a bridge between the ready made database and this office suite. This is almost perfect.

Before you try to develop some "database solution" with Base input forms analog to MS Access, you definitively need to know all the bells and wistles of the application and the limits. StarBasic is certainly the worst language for such a task.
Personally, I use one database of medium complexity (embedded HSQL). It maps thousands of persons to thousands of items and dozends of cost units. It took me one weekend in March to build the database structure with the required core data and another weekend for the input forms.
Meanwhile I spent hundreds of hours using it without a single line of macro code and very few hours for slight adjustments to the form (tab orders, more informative subforms).
- I am the only user,
- it is installed on my laptop alone,
- I do daily backups,
- I am able to write macros but I am also able to adjust myself to slightly awkward input forms.
- I can live very well with the database window as switchboard for the forms and
- using a Linux desktop, I can handle dozends of application windows on virtual desktops (4 for the database on one desktop).
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