I have gone through the Common Application Properties reference page. This contains the list of commonly used spring props.
So, just to explore and find out the convention regarding how and where the above props are declared (read) in java code. I decided to set sailing towards finding spring-data-jpa
related properties. I started to find for the java code where spring.datasource.driverClassName
property is declared (read).
I have looked at these jars:
org.springframework.boot:spring-boot-starter-data-jpa:2.1.7.RELEASE.jar
- this seems to be only a meta jar not a code jar.org.springframework.data:spring-data-jpa:2.1.10.RELEASE.jar
- even this jar seems to not have the declaration(reading) for this property. Or I missed locating it.
Where else should I look? Any suggestions.
I am Just trying to understand spring boot a little deeper.
As debugmode pointed, I understand that we define the value of the property in the .props or .yml file. I am looking for the code where its read.
CodePudding user response:
With regards to spring.datasource.driverClassName
I think you were not looking yet in the right place, as JPA is already an abstraction layer above JDBC.
You should look in org.springframework.boot:spring-boot-autoconfigure
. There you'll find org.springframework.boot.autoconfigure.jdbc.DataSourceProperties
which is annotated with @ConfigurationProperties(prefix = "spring.datasource")
and there you'll find public void setDriverClassName(String driverClassName)