Database Servers: FrontBase

This article was originally published in REALbasic Developer 6.1 (Nov/Dec 2007)

FrontBase is a full-featured database server that is available for Mac OS X, Linux and Windows. It was created by a Denmark company and was initially release just for Mac OS X. But in 2004, it went cross-platform with releases for Windows, Linux (and Unix). And as of April 15, 2006 FrontBase is available for free, with no usage restrictions. You can purchase support services from them, however.

Currently at version 4.2.9, FrontBase has many features you’d associate with a professional database server, including:

  • SQL 92 support
  • Stored procedures
  • EncryptionREALbasic native plug-in
  • Terabyte databases
  • Backups
  • Indexing
  • Migration from MySQL and FileMaker

Installation

The FrontBase download is quite small (only 4.5MB for Windows, 14.6MB for OS X) and installation was straightforward and fast although I did get an error about a missing web component from the Windows installer. Even though FrontBase is free, you do have to go to the trouble of creating an account on the FrontBase web site to get a free license key. You have to request a separate key for each platform and also need to specify either the IP address or MAC address of the computer it will be installed on. Unless your server has a static IP address, it looks like the MAC address is the way to go. Of course obtaining your MAC address could be tricky. On Windows, type IPCONFIG /all and look for the line that says “Physical Address”. On Mac OS X, it is in your Network Preference panel. If you use Linux, I’m sure you can find it on your own.

Once you have this license you need to apply it to FrontBase by cutting and pasting it into a text file and putting this file in the FrontBase folder (\usr\FrontBase). Although this was not the most complicated database installation I’ve had to do, it certainly wasn’t the easiest either.

Database Administration

To access FrontBase, you use either the included SQL92 command line or the Java-based FrontBase JManager, but I had trouble getting that to connect (at least on Windows). The SQL92 command line gives you full control over the database server and the databases it is server, but you’ll obviously need to learn the commands (and there are plenty).

The JManager tool looks decent enough, although it suffers from its odd Java UI. They should really create a version of this in REALbasic.

Documentation

No documentation is installed to your machine, but you can download the 230 page user’s guide (in PDF format) from their web site. Since FrontBase uses SQL 92, you can find some books about that on Amazon. I didn’t find any FrontBase-specific books on Amazon, however. There also was not much information about FrontBase that I could find using Google.

Connecting to REALbasic

I created a sample database by starting the FrontBase SQL92 command line and entering these commands, one on each line:

create database firstdb;
connect to firstdb user _system;
create user test;
commit;
disconnect current;

This gives us a new database, called firstdb, with a user, called test. Now let’s see how easily we can connect to FrontBase using REALbasic. After downloading version 1.92 of the plugin (which, I’m am pleased to see, supports Mac OS X (including Universal Binaries), Windows and Linux), I copied it to the REALbasic plugins folder and started REALbasic (Professional 2008 Release 5). Keep in mind that in order to use databases besides REAL SQL Database, you need to have REALbasic Professional.

In a new blank project, add a PushButton to the default window and switch to its Action event. Add this code:

Dim firstDb As New FBDatabase
 
firstDb.Host = "localhost"
firstDb.DatabaseName = "firstdb"
firstDb.UserName = "test"
 
If firstDb.Connect Then
    MsgBox "Connected!"
Else
    MsgBox "Could not connect."
End If

Run the app and click the button. If everything is set up correctly, then you should get the “Connected!” message.

Now it works just like any other database. You can use firstDb.SQLSelect to process SELECT statements on database tables and you can use SQLExecute to run commands on the database.

Summary

If you can get past the slightly annoying installation, FrontBase seems like it would be worth a look. You’ll probably have to use the command-line, at least for some things, even if you can get the JManager tool to work. The only other database server that is also cross-platform, works with REALbasic and is completely free is PostgreSQL.

Comments are closed.