Skip to content

selecting custom schema in postgres from same DB. Spring boot configuration. #355

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

You must be logged in to vote

Hi @aadarshpanwar, thank you for reaching out. Your use of currentSchema is correct, but you have to set it on the targetDataSourceProps instead of the hikariConfig.

I have modified the config you provided:

      protected HikariConfig hikariConfig(String serverUrl) {
        HikariConfig hikariConfig = new HikariConfig();
        hikariConfig.setUsername(username);
        hikariConfig.setPassword(password);
        hikariConfig.setMaximumPoolSize(maxPoolSize);
        hikariConfig.setMinimumIdle(minimumIdle);
        hikariConfig.setAutoCommit(false);
        // Added schema in hikariconfig. But didnt work
        hikariConfig.setSchema("test2");
        hikariConfig.setDataSourceClassName

Replies: 1 comment

Comment options

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