Skip to content

How can I configure the wrapper with HikariCP and the IAM plugin enabled? #506

Answered by karenc-bq
felixdo asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @felixdo, you can enable plugins by specifying the wrapperPlugins parameter.

Here is a simple example:

public static void main(String[] args) throws SQLException {
    try (HikariDataSource ds = new HikariDataSource()) {

      // Configure the connection pool:
      ds.setUsername(IAM_DATABASE_USER);

      // Specify the underlying datasource for HikariCP:
      ds.setDataSourceClassName(AwsWrapperDataSource.class.getName());

      // Configure AwsWrapperDataSource:
      ds.addDataSourceProperty("jdbcProtocol", "jdbc:postgresql:");
      ds.addDataSourceProperty("serverName", "db-identifier.cluster-XYZ.us-east-2.rds.amazonaws.com");
      ds.addDataSourceProperty("serverPort", "5432"

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@felixdo
Comment options

Answer selected by felixdo
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants