Server Name and Path - Firebird

When you create or move a database, ensure that it is on a hard disk that is physically attached to your server machine. Database files located on shares, mapped drives, or (on UNIX) mounted as SMB (Samba) filesystems cannot be seen by the server.

From Firebird 1.5 onward, you have the option of storing the paths to databases on your server as database path aliases. This not only simplifies the business of setting up portable connection strings in your applications, but also adds an extra layer of security to your remote connections. Database path aliasing prevents sniffer programs from determining where your databases are located and using that information to compromise your files.

Connection String Syntax

These are the “in-clear” connection strings for each platform, which you need for configuring aliases and for attaching clients to databases running on Firebird server versions that do not support database aliasing.

TCP/IP

A TCP/IP connection string has two elements: the server name and the absolute disk/filesystem path as seen from the server. Its format is as follows.

For connecting to a Linux server:

servername:/filesystem-path/database-file

Here’s an example on a Linux or other UNIX-family server named hotchicken:

hotchicken:/opt/firebird15/examples/LeisureStore.fdb

For connecting to a Windows server:

servername:Drive:filesystem-pathdatabase-file

Here’s an example:

hotchicken:C:Program FilesFirebird15examplesLeisureStore.fdb

Forward slashes are also valid on Windows:

hotchicken:C:/Program Files/Firebird15/examples/LeisureStore.fdb

Windows Local Connection

For connecting an embedded client or a local external client in Windows local mode:

C:Program FilesFirebird15examplesLeisureStore.fdb

Windows Networking (Named Pipes/WNet)

For connecting a remote client to a Windows server using the Named Pipes protocol:

\servernamefilesystem-pathdatabase-file">\servernamefilesystem-path database-file

where \servername must be the properly identified node name of the server machine on the Windows network, not a share or a mapped drive. For example,

"file:///\hotchickenc:databasesLeisureStore.fdb"> \hotchickenc:databasesLeisureStore.fdb

Inconsistent Connection Strings for Windows Connections

Superserver on Windows establishes an exclusive lock on the database file when the first client connection is activated to protect databases from a long-standing bug.

The Connection Path Bug

Windows will accept two forms of the absolute local path to a file, one (correct according to the DOS standard) being Drive: path -to -database and the other being Drive:path-todatabase (optionally omitting the backslash following the drive designator).

If the server were to receive two client connection requests, the first using the standard path form and the subsequent one using the optional form, it would treat the two attachments as though they were connected to two different databases. The effects of any concurrent DML operations would cause destructive corruption to the database.

For connections to Superserver, the exclusive lock pre-empts the problem by requiring all connections to use the same path format as was used by the first connection. The same solution cannot be applied to the Classic server process because each connection works with its own instance of the server. Take care to ensure that your application always passes consistent path strings.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Firebird Topics