1

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. This can be any .db file that I do not know of at build time.

I'd like to use Spring/JPA2, but as far as I know it only allows for using databases configured at build-time. Is what I want possible in Spring/JPA2, and if so, how would I approach this?

Mr. Wrong
  • 500
  • 7
  • 21

1 Answers1

0

Is it the same as this?

implement dynamically datasource in spring data jpa

Tried searching for spring boot microservice and webclient if you want other workarounds.

Daniel
  • 93
  • 3
  • 8
  • Those still use preconfigured datatbases, but I could override DataSource. The problem will still be how to start the app without a DataSource and how to switch to the new DataSource once the user opens one. – Mr. Wrong Mar 27 '21 at 20:56
  • how about this [link](https://stackoverflow.com/questions/32074631/spring-boot-application-without-a-datasource). You may check this one also [link](https://www.baeldung.com/spring-boot-configure-data-source-programmatic) – Daniel Mar 29 '21 at 06:24