How to write custom functions for in memory HSQL

2019-06-25 08:02发布

问题:

I want to write a simple function in HSQL so that it is backwards compatible with DB2 functions. In theory I should be able to write a custom function in java and hook it into HSQL. Is there any direction/documentation on just that?

回答1:

User defined functions are documented in the HSQLDB Guide. See this section for functions written in Java.

http://hsqldb.org/doc/2.0/guide/sqlroutines-chapt.html#src_jrt_routines

You can also write your functions in SQL, which is documented in the same chapter of the Guide.