public Connection leaseConn() throws SQLException {
		lock.lock();
		try {
			if (!idleConnections.isEmpty()) {
				Connection conn = idleConnections.firstElement();
				idleConnections.removeElementAt(0);
				if (conn.isValid(1)) {
					busyConnections.add(conn);
					return conn;
				} else {
					conn.close();
					return leaseConn();
				}
			}
	
			if (idleConnections.size() + busyConnections.size() >= maxConnections)
				throw new SQLException("Connection pool is full");
	
			Connection conn = DriverManager.getConnection(url, user, password);
			if (conn.isValid(1)) {
				busyConnections.add(conn);
				return conn;
			} else {
				conn.close();
				throw new SQLException("Failed to validate new connection");
			}
		} finally {
			lock.unlock();
		}
	}