1. 程式人生 > >(解決)Caused by: java.sql.SQLException: 無法轉換為內部表示

(解決)Caused by: java.sql.SQLException: 無法轉換為內部表示

今天遇到了個錯誤:

org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not execute query; uncategorized SQLException for SQL

Caused by: java.sql.SQLException: 無法轉換為內部表示

搞了好久,最後發現其實我一共犯了兩個錯誤,都導致報個這錯誤:

1.是資料庫中的型別寫的是varchar型別的,而在實體類中,寫的是int型別。

2.在model層的實體類的屬性中,我加了下劃線,這也是不可以的。只好用駝峰了。