Firebird Documentation IndexFirebird 1.5.6 Release NotesConfiguring the Port Service on Client and Server → Setting up a client to find the service port
Firebird Home Firebird Home Prev: Using a configuration file parameterFirebird Documentation IndexUp: Configuring the Port Service on Client and ServerNext: Configuring the Services File

Setting up a client to find the service port

Using the connection string
Using port syntax with database aliases
Using a copy of firebird.conf
Location of Firebird artifacts on clients

If you set up your server with the installation defaults (service gds_db listening on port 3050) then no configuration is required. If the server is listening on a different port or is using a different port service name, the client application and/or its host machine need some enabling configuration to help the Firebird client library to find the listening port.

The connection string used by a client can include information for polling the server's listening port in various ways. Firebird 1.5 clients can optionally use a local copy of firebird.conf. Changes may also be needed in the client's services file.

Using the connection string

If only the port number or the service name has been reconfigured, then include the alternative port number or service name in the connection string. This works for all versions of Firebird.

Syntax for TCP/IP connections

To connect to a database named server named alice that is broadcasting on port 3050 with the service name fb_db, the connection string would be:

For POSIX:

  alice/fb_db:/data/teaparty.fdb
          

Or, if the service name is gds_db and the port number is 3051:

  alice/3051:/data/teaparty.fdb
          

For Windows:

  alice/fb_db:D:\data\teaparty.fdb
          

Or, if the service name is gds_db and the port number is 3051:

  alice/3051:D:\data\teaparty.fdb
          

Note

Notice that the separator between the server name and the port is a slash, not a colon. The colon before the physical path string is still required.

Syntax for WNet connections

On a WNet network, use UNC-style notation:

 \\alice@3051\d:\teaparty.fdb
          

or

 \\alice@fb_db\d:\teaparty.fdb
          

If the server's configured port number or service name is an override, then you need to make an entry in the Services file.

Using port syntax with database aliases

To connect through a non-default port with a database alias, affix the port number or service name to the server name, not to the alias. For example, suppose the database alias is stored in aliases.conf as

  rabbit = /data/teaparty.fdb
      

Your application's connection string for server 'alice' would be:

  alice/fb_db:rabbit
      

or

  alice/3051:rabbit
      

Using a copy of firebird.conf

From Firebird 1.5 onward, you can optionally include a client-side copy of firebird.conf in the firebird root directory and configure RemoteServiceName or RemoteServicePort to help the client to locate the server port.

  • You can configure one of these two parameters to extend the override provided for the other one through the connection string (above); or to override only the RemoteServiceName or the RemoteServicePort without using the connection string to do it.

     

  • If you need to avoid passing the port service name or the port number in the connection string and the server is using non-defaults for both, you can configure both RemoteServiceName and RemoteServicePort. You would use this technique if your client application needed to retain the capability to connect to InterBase or Firebird 1.0 servers.

Location of Firebird artifacts on clients

When you rely on firebird.conf on client machines, it is important that the client library knows where to find it. You will need to set up a Firebird root directory and inform the system of its location. Use the FIREBIRD environment variable to do this. Windows clients can alternatively use the Firebird Registry key. With a correct client setup, you can also make use of a local version of the message file.

Prev: Using a configuration file parameterFirebird Documentation IndexUp: Configuring the Port Service on Client and ServerNext: Configuring the Services File
Firebird Documentation IndexFirebird 1.5.6 Release NotesConfiguring the Port Service on Client and Server → Setting up a client to find the service port