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.
我正在使用 javax 命名来连接到 LDAP 数据库。有没有检查连接是否仍然有效的好方法?我在这里寻找真正有效的东西,因为它可能需要经常做。
经过一些网络搜索后,我发现的只是一个快速搜索的建议,还有更轻量级的方法吗?
/苹果电脑
您是否有理由不能假设它仍然有效?这似乎是最有效的。将 LDAP 通信封装在一个类中。您可以通过重新连接然后重新执行请求的操作来处理由于连接断开而导致的任何异常。