Connecting to Firebird database
When connecting to Firebird database, one have to specify
Database name, Server name and Protocol are combined together in the form of connect string.
This is either name of database file (as seen from the server),
or alias defined in
It is better (but not required) to use fully qualified filename,
(avoid using partially specified filenames like "
The name of machine the Firebird server and database file resides on.
(Database files must always be on the local drive of Firebird server.)
When connecting using
Here is list of supported protocols, and how to specify them in connect string:
tcp/ip protocol, it is usually possible
tcp/ip address instead of name (like
however this functionality is not built into Firebird, instead, it is provided
by underlying network layer (e.g. WinSock2), and for some implementations/configurations
it can be much slower than using name.
Users are identified by Username, and validated using Password.
Their privileges can also be determined by specifying Role during connection.
- Local protocol must be used when connecting to embedded Firebird engine.
- Local protocol can't be used when connecting to Classic Firebird engine.
- Possibility to specify
<port_number> is implemented since Firebird 1.
- Possibility to specify
<service_name> works with all Firebird/InterBase versions.
- Named pipes can only be used if the server runs on Windows NT/2000/XP (because Windows 95/98 can't create named pipes.)
- Don't be confused by syntax of Named pipes protocol; although it resembles connecting
to shared resources, the similarity is just pure coincidence.
You should never share folders with database files for public access.
- Firebird 1.5 server can be configured such that some protocols are disabled.
- Firebird 1.5 also allows using alias instead of file name (configured in
The alias can be simple name, but it can also look like fully qualified filename.
- Firebird does not care at all about database file extension, however
some preferred database file extensions are:
*.fdb - Firebird
*.ib - InterBase
*.gdb - used with pre-IB6 versions (not recommended due to problems with Windows' System Restore "feature")
Username and password are either specified by application, e.g. in command line
ISQL D:\DB.FDB -U SYSDBA -P masterkey
or in SQL command
CONNECT 'D:\DB.FDB' USER 'SYSDBA' PASSWORD 'masterkey';
or they can be specified using environment variables. E.g. after setting
it is enough to connect using
(This functionality is built directly into Firebird client library, no support is required in the application.)
The way how other parameters are specified depends on access method used (ISQL, FB API, IBO, FIB+ etc.),
so here is just concise list:
- Only first 8 characters of Password are verified.
- When specifying non existent Role, or Role not granted to the user,
no error is reported and user is connected using default (
- Connection character set (e.g.
SET NAMES <char_set>; command in
- Number of buffer pages (e.g.
CACHE clause in
- Request to keep stable
RDB$DB_KEY values during connection (e.g. using
isc_dpb_dbkey_scope parameter in DPB).
- Request to disable garbage collection during connection (e.g.
-garbage_collect switch of
- Suppress encrypting password on client.
- Name of message file (not sure if this still works in Firebird).
- Setting database properties, like Forced Writes, Read Only, etc.
Copyright © 2004, 2005 Ivan Prenosil