我直接从documentation
在HSQLDB 2.3.4中有以下存储过程函数CREATE FUNCTION an_hour_before (t TIMESTAMP)
RETURNS TIMESTAMP
RETURN t - 1 HOUR;
/;
我尝试用
调用该函数try (Connection connection = this.dataSource.getConnection()) {
try (CallableStatement call = connection.prepareCall("{ ? = call an_hour_before(?)}")) {
...
}
}
我得到一个带有以下堆栈跟踪的NullPointerException
java.lang.NullPointerException
at org.hsqldb.StatementProcedure.getParametersMetaData(Unknown Source)
at org.hsqldb.result.Result.newPrepareResponse(Unknown Source)
at org.hsqldb.Session.execute(Unknown Source)
at org.hsqldb.jdbc.JDBCPreparedStatement.<init>(Unknown Source)
at org.hsqldb.jdbc.JDBCCallableStatement.<init>(Unknown Source)
at org.hsqldb.jdbc.JDBCConnection.prepareCall(Unknown Source)
at com.acme.HsqlTest.test(HsqlTest.java:42)
...
答案 0 :(得分:2)
这是HSQLDB 2.3.4的已知问题,已在SVN存储库中修复。使用早期版本或从/ base / trunk代码编译jar。