Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris

Table or view does not exist

Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I Have created 1 Spring boot project in 2.1.1 version.
I am able to connect to oracle database if configuration defined on file.
but when i am trying to create multiple data base and creating a configuration file and creating data source using datasourcebuilder i am getting table or view does not exists error.

Same thing i am able to do in spring boot version 1.5.0.

Is there any configuration change in spring boot 2.1.1 or can someone provide me a sample configuration with oracle in 2.1.* version.
Posts: 1171
IntelliJ IDE Hibernate Firefox Browser MySQL Database Spring Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the ranch
When you say create do you mean connect?
This is an example of using multiple datasources in springboot:

You do need to instantiate our DataSource beans manually in a configuration class:

Notice that the bean is anotated with @ConfigurationProperties and a config prefix is provided. Inside the method we're using a dataSourceBuilder and SpringBoot will take care of the rest.
This is what happens behind the scene:
When calling the build method on the dataSource it will call it's private bind method:

This private method performs much of the autoconfiguration magic, binding the resolved configuration to the actual DataSource instance
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
    Bookmark Topic Watch Topic
  • New Topic