今天在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