Skip to content
Advertisement

Database error with Java Spring boot Project

I am trying to run a Java Spring Boot survey project (Maven Architecture) in my local machine by following steps —

  1. mvn clean package
  2. connect to created jar file

java -jar target/filename.jar

  1. Open browser and browse to localhost:8080

Project is running ok, I can input survey data, but I am getting following error while trying to show result data from database — Database error

Although I have found that the table “stressresult” already exist in database — Table with data

What’s wrong here? Can anybody kindly help?

Local Machine –>
OS: Debian 11.x 64-bit
Database: MariaDB 10.6.5
Web server: nginx
Java: Oracle JDK 17

Advertisement

Answer

MariaDB is case-sensitive for table names by default. From your screenshot it looks like your query is trying to access STRESS.STRESSRESULT instead of stress.stressresult.

There is an option to lower-case all table names by default:

Try putting this in your config:

[mariadb]
lower_case_table_names=1

That should fix your issue.

Detailed info about this parameter can be found here: https://mariadb.com/kb/en/server-system-variables/#lower_case_table_names

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement