Commit c3cb6b92 authored by 赵建伟's avatar 赵建伟

update codes

parent 6b9f5374
...@@ -43,11 +43,13 @@ public class JdbcConnectPool { ...@@ -43,11 +43,13 @@ public class JdbcConnectPool {
if (connList.size() > 0) { if (connList.size() > 0) {
connection = connList.getFirst(); connection = connList.getFirst();
connList.removeFirst(); connList.removeFirst();
} else if (connList.size() == 0 && currentsize < Integer.valueOf(prop.getProperty("maxSize"))) { currentsize--;
connList.addLast(createConnect()); } else{
connection = connList.getFirst(); while(currentsize < Integer.valueOf(prop.getProperty("maxSize"))){
connList.removeFirst(); connList.addLast(createConnect());
currentsize++; currentsize++;
}
connection = getConnect();
} }
logger.info("Current pool size : {}",currentsize); logger.info("Current pool size : {}",currentsize);
return connection; return connection;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment