如何启动一个独立的Spring Boot JPA应用程序 - 而不是通过cli - 选择数据库来获取数据,例如localhost:5432/my_db; 或192.168.1.100:5432/our_db,或example.com:5432/their_db?
我当前使用application.properties文件中的一个文件,该文件包含:
spring.datasource.driverClassName=org.postgresql.Driver
spring.datasource.url=jdbc:postgresql://localhost:5432/my_db
spring.datasource.username=postgres
spring.datasource.password=postgres
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.generate-ddl=true
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=create
Run Code Online (Sandbox Code Playgroud)
提前致谢