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

update codes

parent 6b9f5374
...@@ -43,12 +43,14 @@ public class JdbcConnectPool { ...@@ -43,12 +43,14 @@ 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--;
} else{
while(currentsize < Integer.valueOf(prop.getProperty("maxSize"))){
connList.addLast(createConnect()); connList.addLast(createConnect());
connection = connList.getFirst();
connList.removeFirst();
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