我是一个发展的初学者。
如何获得application.properties?的“spring.datasource.url=”
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我的数据库在这里输入图像描述
发布于 2022-07-05 07:21:33
您可以使用Properties:
封装java.util.Properties
Properties springProperties = new Properties();
springProperties.getProperty("spring.datasource.url");https://stackoverflow.com/questions/72861373
复制相似问题