commons pool2對象池的使用

在創建一個開銷是很大的對象時,一般咱們都須要對象池,好比數據庫連接、solr連接等等,apache爲咱們提供了一個工具類能夠很快上手。html 代碼以下:java   //鏈接對象 public class Connection { public Connection() { System.out.println("建立了鏈接對象"); } public void open() {
相關文章
相關標籤/搜索