数据库管理器“贷出”与数据库的连接

时间:2017-05-08 20:13:34

标签: java mysql database connection-pooling

尝试滚动我自己的数据库连接池。

  public Connection getConnection() throws SQLException{
    List<Connection> idleConnections;
    List<Connection> loanedConnections;
    // try to reclaim any previously loaned out connections
    // return a connection from my available pool
    // if there's none enter code here`available, create a new one, add it to my pool, then load it out
  }

我知道存在这样的事情,比如dbcp(https://commons.apache.org/proper/commons-dbcp/)。只是想知道是否有办法从这样的经理那里“借出对象”?

0 个答案:

没有答案