-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Databases that support embedded and non-embedded modes are always detected as embedded #23538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
That's correct. Your H2 database is being identified as an embedded database so the username defaults to I think it could be argued that H2 shouldn't be identified as embedded in this case as it's running separately. While we consider that, you should be able to work around the problem by post-processing the DataSource: @Bean
public static BeanPostProcessor clearDataSourceUserName() {
return new BeanPostProcessor() {
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
if (bean instanceof HikariDataSource) {
((HikariDataSource) bean).setUsername("");
}
return bean;
}
};
} |
We should look for the |
Can this be worked on? |
@somayaj thanks for asking to contribute. This one may be a little hard to fix on surface but if you have already looked at it and have an idea how to fix it, please let us know and we can review a PR. |
@snicoll yes, I've checked in the code changes. Please review. Thanks. |
Closing in favour of PR #23693 |
Uh oh!
There was an error while loading. Please reload this page.
I have an h2 database created without username/password.
I have a basic spring boot web+jpa application, in my
application.properties
I have justspring.datasource.url = jdbc:h2:~/test
I can access with the h2 driver from the commandline, for example (using absolute path to show the versions)
Unfortunately if I launch the application I have
from what I understood the problem is that by default the username set up is
SA
.My problem is that I can't find a way to set "no username" in the
application.properties
.I tried with
but all of them ended with the same error
It seems to me that it's not possible to set "no username"
The text was updated successfully, but these errors were encountered: