我想用在春季查詢, 一個表名,但是當我執行它,我得到這個以下錯誤:
春@Query刪除報價
"could not extract ResultSet; SQL [n/a]; nested exception is
org.hibernate.exception.SQLGrammarException: could not extract ResultSet"
由於彈簧自動添加引號「的時候參數是一個字符串PARAM ..
@Query(value = "desc :name", nativeQuery = true)
List<RepositoryColumn> getColumnFromRepository(@Param("name") String name);
在其他情況下,我想"desc table_name"
而不是"desc 'table_Name'"
任何想法?
這與Spring沒有任何關係,但參數替換如何與JDBC一起工作。這些查詢不能使用參數綁定。 –
您可以創建一個程序,該程序將「執行即時」這個查詢 –