Tag Archives: nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet

nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet

Knowledge map advanced must read: read how large-scale map data efficient storage and retrieval>>>

Problem description

This error report means that the result cannot be mapped. Just map the relationship between Java entity and database table. Be sure to see your own configuration file, your own database

Arrange the treatment ideas to avoid detours

1. First, verify whether the code is written
string SQL = “select count (1) from dual”
jdbcTemplate.queryForMap(sql ); 2. I couldn’t figure it out. When I first tested it, it was ok, indicating that there was no problem with the program code. I changed a library, and it was wrong. 2. It’s OK for me to take the printed SQL and run it in the library. I was in a trance and doubted my program, but to no avail, Then I checked the configuration file and found that I found the wrong database
3. But if the database is wrong and the table is not created, I should report table or view not found
4. Re create the table OK

Reflection summary:

1. As the saying goes, doctors can’t treat themselves, so they are easy to get close to the dead end, but if they are sure that the program is OK, they can directly check the configuration file, seek the help of colleagues, and get busy with other things, so they can jump out of the thinking circle
2. Seriously understand the mistakes and narrow the scope

This article is shared in the blog “windward bird” (CSDN).