I'm just connected this DB in Intellij IDEA and it's fine, but when I launch my Spring Boot App with this configs, I see this trouble's messages
***Configs on pics
2019-05-28 20:56:53.487 ERROR 700 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
Process finished with exit code 0
We need to add a bean for DataSource in the configuration class, something like this
@Bean
public DataSource dataSource(){
DriverManagerDataSource source = new DriverManagerDataSource();
source.setDriverClassName(driverClass);
source.setUrl(url);
source.setUsername(username);
source.setPassword(password);
return source;
}
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments