Currently I am using HikariDataSource to create a datasource. For that I am initing it with username, password, jdbcurl etc which will be then used by EntityManagerFactory.
HikariDataSource ds = new HikariDataSource();
ds.setDriverClassName("org.postgresql.Driver");
ds.setJdbcUrl("jdbc:postgresql://127.0.0.1:5432/db");
ds.setUsername("usr");
ds.setPassword("pw");
LocalContainerEntityManagerFactoryBean emf = new LocalContainerEntityManagerFactoryBean();
emf.setDataSource(dataSource());
Now I want to use Amazon RDS for database. IAM is setup and doing it via terminal works well (getting token by providing Access Key and Secret Key and then using this token to connect to database.
I have managed to create the token in my code but I think HikariDataSource does not provide this functionality to connect by token. Connection was successful to the database, but it did not accept the token as password.
Any recommendations or methods I could create the datasource for the EMF?