Spring Boot Multi-Database Configuration: Connecting to Multiple MySQL Databases Multiple datasource

Sdílet
Vložit
  • čas přidán 7. 09. 2024
  • In this tutorial, we'll explore how to configure a Spring Boot application to connect to multiple MySQL databases.
    Git: github.com/Pla...
    You'll learn how to set up data source configurations for each database, define entity classes, and create repositories to perform database operations. We'll also cover how to handle transactions and manage multiple data sources efficiently. Whether you're building a microservices architecture or need to work with multiple databases in a single application, this video will provide you with the essential knowledge and step-by-step guidance to seamlessly connect your Spring Boot application to multiple MySQL databases. Don't forget to like and subscribe for more in-depth Java and Spring tutorials!
    #multipledatasource #springbootmysql #playjava

Komentáře • 6

  • @razatech22
    @razatech22 Před 2 měsíci +1

    Connect with two different databases i.e. mysql &postgreSQL

  • @VinodhNBK
    @VinodhNBK Před 8 měsíci

    I am getting below error. Any idea?
    Your input is greatly appreciated.
    Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
    Reason: Failed to determine a suitable driver class
    Action:
    Consider the following:
    If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
    If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

  • @revanthgoud8129
    @revanthgoud8129 Před 4 měsíci

    How to auto create table I have used spring.jpa.generate-ddl=true but it s not working

  • @VinodhNBK
    @VinodhNBK Před 8 měsíci

    I was able to resolve the previous error.
    However, when i try to make API call, I see null values are getting added in the table except the ID column. Any idea where I am doing wrong?

    • @laijie9866
      @laijie9866 Před 7 měsíci

      Check if you are using the repository properly, if so, then maybe it could be from the requests that you are doing if the controller is not storing the data

  • @pranoydas9654
    @pranoydas9654 Před 7 měsíci

    Why the tables are not generated automatically?