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.
多くの異なるタスクを実行する JDBC 接続を備えた Java アプリケーションがあります。私の質問は、パフォーマンスに最適なものは次のとおりです。
毎回新しい接続を開くのは簡単な操作ではないため、接続の再利用が最善の方法です。 そのため、接続プールがあります。プールによってキャッシュされ、管理される一連の接続があります。接続を取得して戻すたびに。
毎回新しい接続を作成するのではなく、接続の再利用を検討する必要があります
接続を管理するには Semaphore クラスをお勧めします。