2

Can I use the database without the database name with JPA?

spring.datasource.url=jdbc:mariadb://localhost:3307

Alvin
  • 8,219
  • 25
  • 96
  • 177

1 Answers1

1

No. You will get the error "No database selected". What do you want to accomplish with this?

Filip123go
  • 365
  • 1
  • 6
  • 18
  • I wan to use different schema in the same database, without defining two different connection. – Alvin Mar 12 '19 at 13:28
  • You can declare multiple db names and then choose which to use. check here : https://stackoverflow.com/questions/42179442/spring-boot-how-to-use-multiple-schemas-and-dynamically-choose-which-one-to-use/42360877 If you do not give us more info we cannot help you much more... – Filip123go Mar 12 '19 at 13:53