0

I am learning Spring Framework from online tutorials. In the tutorial, the instructor is using Spring JDBC and the H2 database and a data.sql file to populate tables. He also changed the dialect from "General SQL" to "MySQL" dialect as we are going to use MySQL in future videos, so I am just following the tutorial.

All just went well, but when I created data.sql and changed the dialect in my classpath, I was getting errors on a table name like this:

Unable to resolve <table> and table names and columns are showing in red color as errors.

I don't know what's happening, and I have tried every solution on the Internet. I am attaching my source code and data.SQL screenshot.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
  • This is an **IntelliJ** question. It is not actually about Spring JDBC, Spring Boot, or H2. Also note these are not errors, they are just info that you haven't wired up IntelliJ to inspect your local database. Doing that enables nice features but is totally optional. Aside: your only errors in the .java file are because you misspelled "_description_". – AndrewF Feb 11 '22 at 02:06
  • The title of this question says "Spring Boot is not initialize Data on Startup" — if you have saving some sort of issue with Spring Boot and startup, that is not described here, and that probably should go into a new question. Please clean up the title & tags of this question to reflect the problem described & answered. – AndrewF Feb 11 '22 at 02:19

1 Answers1

0

You are not actually seeing errors, that is, IntelliJ doesn't know enough about your database to know whether you have any problem that should generate an error.

Then you will be able to use IntelliJ's DB features, if you want to (or if your course requires you to use those features).

In this case, you will probably need to already have a table called category in that database with the right layout, or you will start seeing errors.

AndrewF
  • 1,827
  • 13
  • 25