private DbConnectionPool() { pool = new ArrayList<Connection>(); this.createConnection(); } publicstatic DbConnectionPool getInstance() { if (instance == null) { instance = new DbConnectionPool(); } returninstance; } publicsynchronized Connection getConnection() { if (pool.size() > 0) { Connection conn = pool.get(0); pool.remove(conn); return conn; } else { returnnull; } } privatevoid createConnection() { int temp = ResourceManager.getPoolSize(); if(temp > 0){ this.poolSize = temp; } for (int i = 0; i < poolSize; i++) { try { Class.forName(ResourceManager.getDriverClass()); conn = DriverManager.getConnection(ResourceManager.getUrl(),ResourceManager.getUsername(),ResourceManager.getPassword()); pool.add(conn); } catch (ClassNotFoundException e) { |