問題描述
我正在嘗試從我的 Java 應用程序連接到 Linux 服務器上的 IBM DB2 9 數據庫.我正在使用 db2jcc.jar
(DB2 通用 JDBC 驅動程序).
I am trying to connect to an IBM DB2 9 database on a Linux server from my Java application. I am using db2jcc.jar
(DB2 Universal JDBC Driver).
建立連接需要花費大量時間.有什么問題?我知道有很多因素可能導致這種情況,但我想深入了解根本原因.
Establishing a connection is taking a ridiculous amount of time. What could be wrong? I know there are a lot of factors that could cause this, but I want to get down to the root cause.
推薦答案
首先我會嘗試提高驅動程序的日志級別以進行調試甚至跟蹤.這可能會給您一種簡單的方法來查看它在嘗試完成連接時掛在哪里.你在用 log4j 嗎?
First off I would try to up the log level on the driver to debug or even trace. This might give you an easy way of seeing where it is hanging in it's attempt to complete the connection. Are you using log4j?
這篇關于Java 中的 DB2 連接速度極慢的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!