遇到一坑:對於如下代碼
select * from order_mileagefuel where date > '2015-11-1' and date< '2015-11-5'
在PostgreSQL的客戶端中執行時能得到結果,但在Java中執行時(此時時間范圍是參數,類型為String),如date >=#{startDay} and date <=#{endDay}
執行時報如下錯誤:(而對於MySQL,在代碼中卻是能夠正確執行的。)
ERROR: operator does not exist: timestamp without time zone > character varying
解決方法:將String類型的參數改為java.sql.Timestamp