小编Lui*_*sco的帖子

Spring Boot JPA数据库选择

如何启动一个独立的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)

提前致谢

postgresql jpa spring-boot

11
推荐指数
1
解决办法
3万
查看次数

标签 统计

jpa ×1

postgresql ×1

spring-boot ×1