0
我需要在運行時動態創建Spring Boot Datasources。有人知道怎麼做嗎。有效,我需要做這個需求:在運行時以編程方式定義和刪除Spring Boot/Spring JPA數據源?
spring:
datasource:
url: jdbc:h2:mem:testdb1;
username: sa
password:
driver-class-name: org.h2.Driver
platform: h2
spring:
datasource:
url: jdbc:h2:mem:testdb2;
username: sa
password:
driver-class-name: org.h2.Driver
platform: h2
...
spring:
datasource:
url: jdbc:h2:mem:testdbN;
username: sa
password:
driver-class-name: org.h2.Driver
platform: h2
的思考?
參見[此帖](http://stackoverflow.com/questions/41373968/no-persistence-provider-for-entitymanager-named評論#comment69951793_41373968)和[this](http://stackoverflow.com/questions/41352624/dynamically-updating-entitymanager-in-spring-boot-jpa#comment69916547_41352624)。 – manish