今天在java項目中使用h2做單元測試,報如下錯誤:
Caused by: org.h2.jdbc.JdbcSQLException: Function "TO_TIMESTAMP" not found
解決方法是,將低版本的h2引用,改為1.4.195版本或以上版本的h2 jar包,將maven引用改為:
<dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <version>1.4.195</version> </dependency>
參考:
1.Caused by: org.h2.jdbc.JdbcSQLException: Function "TO_TIMESTAMP"
https://stackoverflow.com/questions/45581929/caused-by-org-h2-jdbc-jdbcsqlexception-function-to-timestamp-not-found-sql