java.sq.SQLException: Column not found

前端 未结 1 767
我在风中等你
我在风中等你 2021-01-12 05:32

I am receiving the following error:

HTTP Status 500 - Request processing failed; nested exception is
org.springframework.jdbc.BadSqlGrammarException: Stateme         


        
相关标签:
1条回答
  • 2021-01-12 06:19

    Check your SQL statement -- you need to include the category_id in the column list:

    String sql = "SELECT id, name, category_id FROM track WHERE category_id = " + categoryId + " ORDER BY name";

    It is failing because you're trying to extract category_id from the ResultSet and it isn't there.

    0 讨论(0)
提交回复
热议问题