[英]How to let a user select a database at runtime for Spring-data-JPA
I'm writing a JavaFX application that needs to talk to a SQLite database, stored as a.db file, that the user has selected from their filesystem.我正在编写一个 JavaFX 应用程序,该应用程序需要与 SQLite 数据库通信,存储为 a.db 文件,用户从他们的文件系统中选择。 This can be any.db file that I do not know of at build time.
这可以是我在构建时不知道的 any.db 文件。
I'd like to use Spring/JPA2, but as far as I know it only allows for using databases configured at build-time.我想使用 Spring/JPA2,但据我所知,它只允许使用在构建时配置的数据库。 Is what I want possible in Spring/JPA2, and if so, how would I approach this?
在 Spring/JPA2 中我想要什么,如果是,我将如何解决这个问题?
Is it the same as this?和这个一样吗?
implement dynamically datasource in spring data jpa 在 spring 数据 jpa 中动态实现数据源
Tried searching for spring boot microservice and webclient if you want other workarounds.如果您需要其他解决方法,请尝试搜索 spring 引导微服务和 Web 客户端。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.