Skip to content
Advertisement

Can’t create method to get data from database hibernate mySQL + Spring mvc

my page

I really hope for your help! The situation is this: I’m trying to get the value of my disciplines from the database, these disciplines are related to the semester. In the display page, the user must select the semester he needs, after which he clicks on the selection button and all disciplines associated with this semester should be displayed. But I always get the same error “The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.” I am attaching all the code that I wrote to perform this action.

JavaScript
JavaScript
JavaScript

Advertisement

Answer

The implementation of getDisciplineSemestrId in SemestrImpl looks fishy. You create select query, but then execute update on it, and return the query itself cast to List.

Try this:

JavaScript

Query getResultList() executes a select query and returns the result, while executeUpdate() executes update or delete statements.

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