火鸟 别名
我使用 Delphi 和 Firebird 1.5 开发了一个应用程序,其中服务器与应用程序位于同一台机器上。我现在正在将应用程序部署到另一个站点,其中 Firebird 服务器(超级服务器)在一台计算机 (NT4) 上运行,而客户端在另一台计算机上运行。
如果我在应用程序中包含限定路径 (t:\db\cinema.gdb
),应用程序就可以连接到数据库,但我自然更愿意使用别名,以便相同的代码在我的开发机器上工作(使用本地服务器)。
那么,有两个问题:
- “aliases.conf”文件应该存在于哪里 - 与应用程序一起在每台计算机上,还是在服务器上?
- 别名应该是什么?
cinema = t:\db\cinema.gdb
,假设数据库位于映射驱动器 t 上?cinema = 192.168.2.121:f:firebird\db\cinema.gdb
,使用服务器的 IP 地址和服务器看到的数据库路径?
I have developed an application using Delphi and Firebird 1.5, where the server is located on the same machine as the application. I am now deploying the application to another site, where the Firebird server (Superserver) is running on one machine (NT4) whilst the client is running on another machine.
The application can connect to the database if I include the qualified path in the application (t:\db\cinema.gdb
), but naturally I would prefer to use an alias, so that the same code will work on my development machine (with the local server).
So, two questions:
- Where should the 'aliases.conf' file exist - on each machine along with the application, or on the server?
- What should the alias be?
cinema = t:\db\cinema.gdb
, assuming that the database is on a mapped drive t?cinema = 192.168.2.121:f:firebird\db\cinema.gdb
, using the IP address of the server and the path to the database as the server sees it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
servername:alias
进行连接。cinema = c:\firebird\db\cinema.fdb
. Don't use a mapped drive, this decreases performance. The client connects with database nameservername:alias
.aliases.conf 应该仅位于服务器上。
您应该始终使用完整地址、IP 和服务器上数据库的完整路径。由于驱动器映射可能会发生变化(而且它们总是在您最意想不到的时候发生变化),因此将它们用作对应位于固定位置的文件或数据库的引用很少是个好主意。
就我个人而言,我在 C++Builder / Firebird 应用程序中根本不使用别名,而只是在程序 ini 文件中设置完整路径或作为注册表项(当然在客户端)。无论如何,ini 文件都在那里,我不会创建对 aliases.conf 文件的另一个依赖项。
The aliases.conf should be on the server only.
And you should always use the full address, with the IP and the full path to the database on the server. Since drive mappings may change (and they always do when you least expect it) it is seldom a good idea to use them as a reference to files or databases that should be in a fixed location.
Personally I do not use aliases at all in my C++Builder / Firebird application but just set up the full path in the programs ini file or as a registry entry (on the client side of course). The ini-file is there anyway and I do not create another dependency on the aliases.conf file.