[英]org.hsqldb.HsqlException: user lacks privilege or object not found: DATE_FORMAT
I'm getting the error below while running Junit for the hibernate class I made... So far whatever I googled, I found that I need to set sql.syntax_mys=true for db connection for Junit .我在为我制作的休眠类运行 Junit 时遇到以下错误......到目前为止,无论我用谷歌搜索什么,我发现我需要为 Junit 的 db connection 设置 sql.syntax_mys=true 。 But it doesn't work.但它不起作用。
datasource.url=jdbc:hsqldb:mem:data-test;sql.syntax_mys=true;shutdown=false
Because not exist function DATE_FORMAT(sysdate(),'%Y')<\/code> for hsqldb
因为 hsqldb 不存在函数
DATE_FORMAT(sysdate(),'%Y')<\/code>
Try using for hql:
to_char(mydate,'yyyy')<\/code>
尝试使用 hql:
to_char(mydate,'yyyy')<\/code>
In fact, you will have to write a different query for testing and for production code实际上,您将不得不为测试和生产代码编写不同的查询
"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.