DATABASE HOW-TO

INDEX:


For Windows users


For Linux users


OS independent (JdbM)


Install Firebird SQL database server on Windows

Note: I had to change the program path in the registry before it worked (I used E:\programs\firebird\.. and the subdirectory \firebird\ was not included in the path for some reason).

When the server is running, you should see a “fb_inet_server” or “fbserver” process running.

or alternatively

and the firebird symbol will appear in the taskbar. Also you will find a “fbserver” process running


Install JDBC driver for FirebirdSQL on Windows


Install Firebird SQL database server on Linux



Install JDBC driver for FirebirdSQL on Linux



Install JdbM

or

or

In LINUX you separate the path entries by a colon

Further help can be obtained from the helpfile at www.ahrauch.com in the support section.


Create a database in Firebird SQL

This wil log you in as the system adminstator.

Note that with the semicolon you will always commit a command in isql.

to quit the isql program

When you go to the PathToDatabase you should find the database myfirst.fdb now. Everything else can be done from JdbM in a more comfortable way.



Connect JdbM to a Firebird database, create tables, queries and forms


Step 1: Start JdbM and create a database session

jdbc:firebirdsql:Servername/Portname:PathToDatabase

For local databases the Servername is “localhost”. In our example this would be

NOTE: When you are more familiar with Firebird you should change these settings to avoid security problems.


Step 2: Open the database session and create a database table


Step 3: Create and examine a database table



Step 4: Create a query and a datagrid to enter data



Step 5: Create a database with a main form and an attached table (subform)


Let’s imagine we want to enhance our first database.

Table books could for example hold the description of a book and a second table, related to the books table, could hold a short description of every chapter in the book. Thus we would have a parent / child relationship between book and chapter that can best be expressed in a parent/child form.


What do we need to acomplish this task:

How this is done is already explained in Step 4. Just to give you a little help here is the script that creates the database table:

This is also done analogous to Step 4 BUT the query contains a JdbM special command $MASTER and looks like this

This will give us the neccesary “join” between the master form “My books” and the subform “Chapters”


The contents of this tutorial project you can find in the project file “tutorial.jdb” that you can download from www.ahrauch.com


Happy computing!


a.rauch@ahrauch.com