Free Embedded Database


Guys… udah pernah denger tentang Firebird database? Kalau belum, coba deh baca postingan temenku di sini yang merupakan terjemahan dari tulisan Carlos H. Cantu.

Seperti yang dapat kalian lihat di bagian komentar, mengenai sample aplikasi Delphi yang terhubung ke embedded Firebird, memang benar apa yang dikatakan Bisma temenku itu, bahwa secara aplikasi tidak ada perbedaan sama sekali.

Nah tetap saja buat programmer Delphi yang terbiasa melakukan koneksi ke Firebird dengan Guardian yang nongol mesra sebagai tray icon application atau sebagai service, pasti rada bingung gimana bisa RDBMS jalan tanpa ada service sama sekali. Nah instead of nerangin apa yang mesti dilakukan, eh Bisma cuma menjawab silakan mengacu pada dokumentasi teknis Firebird. Itu mah nggak usah diceritain. Pembaca kan maunya enaknya aja. Wong sekalian posting kenapa gak sekalian aja diceritain. Dasar Bisma. Kadang emang nyebelin kalau dah males ngasih example.

Ya udah aku ngalah deh. Segeralah aku meluncur ke Firebird Website di sini. Ternyata versi yang embedded ada di sini.

Nah inilah readme.txt yang wajib dibaca sebelum menggunakan Firebird Embedded, dan mudah sekali ternyata:

———————————————————–
Firebird 2.0 Embedded Server notes
———————————————————–

1. GENERIC INFORMATION

The embedded server is a fully functional server linked
as a dynamic library (fbembed.dll). It has exactly the
same features as the usual server and exports the
standard Firebird API entrypoints.

2. ISSUES AND LIMITATIONS

2.1. Registry

The Firebird registry entries are ignored. The root
directory of the embedded server is the directory of
its binary file (library).

2.2. Database access

Client access can be only via the local protocol,
i.e. NOT a TCP/IP connection string that includes
the server name “localhost” or IP address 127.0.0.1.

The embedded server supports only the local connect
to a database file path without a server name. The
client program gets an exclusive access to the
database file after successful connect.

The embedded server acts as a true local server for a single
client accessing databases on a local machine. It can also
act as a remote gateway that redirects all network calls to
other hosts, just as the regular client library
does.

2.3. Authentication and security

The security database (namely security2.fdb) is not used
in the embedded server and hence is not required. Any
user is able to attach to any database. Since both
the server and the client run in the same address space,
the security becomes just an agreement between both
sides which can be easily compromised.

But note that SQL privileges are still checked.

2.4. Compatibility

You may run any number of applications with the embedded
server without any conflicts. Having IB/FB server running
is not a problem either.

But you should be aware that you cannot ac
cess single

database from a number of the embedded servers
simultaneously, because they have SuperServer architecture
and hence exclusively lock attached databases.

3. USAGE

Just copy fbembed.dll, icudt30.dll, icuin30.dll and
icuuc30.dll into the directory with your application.
Then rename fbembed.dll to either fbclient.dll or
gds32.dll depending on your database connectivity software.
Then start your application and it will use the embedded
server as a client library and will be able to access
local datasases. You should also copy firebird.msg and
firebird.conf (if necessary) to the same directory.


If external libraries are required for your application,
then you should have them separately. Most probably, it
will be INTL support (fbintl.dll and fbintl.conf) or UDF
libraries. To be able to use them, you should place them
into the directory tree which emulates the Firebird server
one, i.e. has subdirectories like /intl or /udf:

c:my_appapp.exe
c:my_appgds32.dll
c:my_appib_util.dll
c:my_appicudt30.dll
c:my_appicuin30.dll
c:my_appicuuc30.dll
c:my_appfirebird.conf
c:my_appfirebird.msg
c:my_appintlfbintl.dll
c:my_appintlfbintl.conf
c:my_appudffbudf.dll

If you want to place the Firebird files (excluding the
renamed fbembed.dll) in another directory, you need to
modify your firebird.conf and set RootDirectory to the
Firebird directory tree. Example:

c:my_appapp.exe
c:my_appgds32.dll
c:my_appib_util.dll
c:my_appicudt30.dll
c:my_appicuin30.dll
c:my_appicuuc30.dll
c:my_appfirebird.conf
d:fbfirebird.msg
d:fbintlfbintl.dll
c:fbintlfbintl.conf
d:fbudffbudf.dll

firebird.conf:
RootDirectory = d:fb

Jadi inilah file yang aku letakkan bersama aplikasiku (exe file):

Kemudian aku coba buat aplikasi sederhana, meletakkan sebuah object
TIBDatabase dan sebuah TIBTransaction. Keduanya saling dihubungkan.

Pada event FormCreate aku tinggal mencoba konektivitasnya:

procedure TForm1.FormCreate(Sender: TObject);
begin

IBDatabase.DatabaseName := ExtractFileDir(ParamStr(0)) + ‘DatabaseTEST.GDB’;

//database aku letakkan dalam folder database di bawah exenya

IBDatabase.Connected := true;

end;

Selesai!

Iklan

Posted on April 23, 2008, in Ulasan. Bookmark the permalink. Tinggalkan komentar.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: