While the code can be compiled, something seems off with the class as IntelliJ cannot access auto-complete and it seems to the IDE the class would be inaccessible:
DB2ConnectionFactory connectionFactory = new DB2ConnectionFactory(
DB2ConnectionConfiguration.builder().database(database.getDatabase()).host(database.getHostname())
.port(database.getPort()).username(database.getUsername()).password(database.getPassword()).build());

While the code can be compiled, something seems off with the class as IntelliJ cannot access auto-complete and it seems to the IDE the class would be inaccessible: