File: README.connection_strings

package info (click to toggle)
firebird4.0 4.0.6.3221.ds6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 41,964 kB
  • sloc: ansic: 393,248; cpp: 356,542; sql: 15,263; yacc: 8,713; fortran: 5,645; sh: 5,184; pascal: 3,328; makefile: 1,342; asm: 271; perl: 194; xml: 55; csh: 15; awk: 1
file content (163 lines) | stat: -rw-r--r-- 4,235 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
------------------
Connection strings
------------------

Connection string is a local or remote path to the database being attached.

The legacy syntax (supported by all Firebird versions) is the following:

For TCP (aka INET) protocol:

  <host> [ / <port>] : <file path to database or alias>

For named pipes (aka NetBEUI, aka WNET) protocol:

  \\ <host> [ @ <port>] \ <file path to database or alias>

For local connections as simple as:

  <file path to database or alias>

If host name is omitted, local connection is implied. Depending on settings,
platform and Firebird version, it could be performed via either the embedded
engine or XNET (shared memory) protocol or TCP localhost loopback.

Examples:

  Connect via TCP using database name:

    192.168.0.11:/db/mydb.fdb
    192.168.0.11:C:\db\mydb.fdb
    myserver:C:\db\mydb.fdb
    localhost:/db/mydb.fdb

  Connect via TCP using database alias:

    192.168.0.11:mydb
    myserver:mydb
    localhost:mydb

  Connect via TCP using non-default port 3051:

    192.168.0.11/3051:C:\db\mydb.fdb
    192.168.0.11/3051:mydb
    myserver/3051:/db/mydb.fdb
    localhost/3051:/db/mydb.fdb
    myserver/3051:mydb
    localhost/3051:mydb

  Connect via TCP using non-default service name:

    192.168.0.11/fb_db:C:\db\mydb.fdb
    192.168.0.11/fb_db:mydb
    localhost/fb_db:/db/mydb.fdb
    myserver/fb_db:/db/mydb.fdb
    myserver/fb_db:mydb
    localhost/fb_db:mydb

  Connect via named pipes:

    \\myserver\C:\db\mydb.fdb
    \\myserver@fb_db\C:\db\mydb.fdb

  Local connection:

    /db/mydb.fdb
    C:\db\mydb.fdb
    mydb

Additionally, Firebird 3.0 introduces generalized URL-like syntax for
connection strings:

  [ <protocol> : // [ <host> [ : <port> ] ] ] / <file path to database or alias>

Where protocol is one of: INET (means TCP), WNET (means named pipes) or XNET
(means shared memory).

Examples:

  Connect via TCP using database name:

    inet://192.168.0.11//db/mydb.fdb
    inet://192.168.0.11/C:\db\mydb.fdb
    inet://myserver/C:\db\mydb.fdb
    inet://localhost//db/mydb.fdb

  Connect via TCP using database alias:

    inet://192.168.0.11/mydb
    inet://myserver/mydb
    inet://localhost/mydb

  Connect via TCP using non-default port 3051:

    inet://192.168.0.11:3051/C:\db\mydb.fdb
    inet://192.168.0.11:3051/mydb
    inet://myserver:3051//db/mydb.fdb
    inet://localhost:3051//db/mydb.fdb
    inet://myserver:3051/mydb
    inet://localhost:3051/mydb

  Connect via TCP using non-default service name:

    inet://192.168.0.11:fb_db/C:\db\mydb.fdb
    inet://192.168.0.11:fb_db/mydb
    inet://localhost:fb_db//db/mydb.fdb
    inet://myserver:fb_db//db/mydb.fdb
    inet://myserver:fb_db/mydb
    inet://localhost:fb_db/mydb

  The "inet" protocol can be replaced by "inet4" or "inet6" to restrict client
  to IPv4 or IPv6 addresses corresponding to supplied name ("inet" protocol
  tries all addresses in the order determined by OS):

    inet4://myserver/mydb
    inet6://myserver/mydb

  Connect via named pipes:

    wnet://myserver/C:\db\mydb.fdb
    wnet://myserver:fb_db/C:\db\mydb.fdb

  Loopback connection via TCP:

    inet:///db/mydb.fdb
    inet://C:\db\mydb.fdb
    inet://mydb

  Loopback connection via named pipes:

    wnet://C:\db\mydb.fdb
    wnet://mydb

  Local connection via shared memory:

    xnet://C:\db\mydb.fdb
    xnet://mydb

  Local (embedded by default) connection:

    /db/mydb.fdb
    C:\db\mydb.fdb
    mydb

If protocol and host name are omitted, local connection is implied. Depending on settings,
it could be performed via either the embedded engine or XNET (shared memory) protocol
or TCP localhost loopback.

On the server side, default provider configuration is:

  Providers = Remote, Engine13, Loopback

It means that if the remote provider fails to match the connection string (because of missing
protocol / host parts), then the embedded engine handles the hostless connection. If you need
to connect locally using a specific transport protocol, please specify:

  inet://<file path to database or alias>
  or
  wnet://<file path to database or alias>
  or
  xnet://<file path to database or alias>

Note: WNET (named pipes) and XNET (shared memory) protocols are available on Windows only.