Issue
I am a beginner at developing.
How to get"spring.datasource.url=" for application.properties?
application.properties
spring.datasource.url=jdbc:mysql://localhost:3306/sms?useSSL=fals&serverTimezone=UTC&useLegacyDatetimecode=false
spring.datasource.username=root
spring.datasource.password=123123
#Hibernate
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
#Hibernate auto ddl
spring.jpa.hibernate.ddl-auto=update
logging.level.org.hibernate.SQL=DEBUG
My Database enter image description here
Solution
you can used Properties:
package java.util.Properties
Properties springProperties = new Properties();
springProperties.getProperty("spring.datasource.url");
learn more => https://www.javatpoint.com/properties-class-in-java
Answered By - Omar Hussien
Answer Checked By - David Marino (JavaFixing Volunteer)