からHSQL機能を呼び出すと、ストレートdocumentation私はHSQLDB 2.3.4で次のストアドプロシージャ機能を持っているJDBC
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)
...
'this.dataSource.getConnection()は' null'を返しますか? –
@GordThompson '#prepareCall'のHSQLDB実装の内部では' NullPointerException'はありません –