Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 Delphi 7 和 ZeosLib 6.6.5 开发 Windows 后台服务。
该服务将 24/7 全天候运行并与位于远程服务器上的 Firebird 数据库(2.1 版)进行交互,因此我需要检查该服务是否仍然能够与其通信。
最好的方法是什么?在对数据库执行任何操作之前使用我的 TZConnection 中的 Ping 或 PingServer 函数?
祝你今天过得愉快。
使用 ZConnection.ping 测试您的连接,如果丢失,您必须使用 ZConnection.reconnect 保持会话处于活动状态(我在许多项目中使用相同的方法)