2010年12月6日 星期一

Exception:Select expression results in more than one column having same name. Column name 'rply_time' is specified more than once

原因:Column name在 select敘述裡重複。

Exception:org.springframework.dao.IncorrectResultSizeDataAccessException: Incorrect result size: expected 1, actual 4

在spring下,db使用queryForMap時,出現的錯誤。


原因:select salary from user where 1 = 2 的結果是 salary (返回第0行),會抛出IncorrectResultSizeDataAccessException。


所以最好還是用queryForList, 返回的list的size為0,表示找不到資料。除非確定資料select出來一定至少有一筆,才使用queryForMap。

<%-- = = = = = = = = = = = = = = = = = 以上 = = = = = = = = = = = = = = = = = --%>

高雄聚會餐館

ボードゲーム予定

ボードゲーム持っている

<%-- = = = = = = = = = = = = = = = = 以下空白 = = = = = = = = = = = = = = = = --%>