简体   繁体   English

模拟对HSQLDB中Oracle包函数的调用

[英]Mimic a call to Oracle package function in HSQLDB

I am looking for a way to mimic a call to Oracle package function in my embedded database. 我正在寻找一种在嵌入式数据库中模拟对Oracle软件包功能的调用的方法。 I use the following code to call a function: 我使用以下代码来调用函数:

conn.prepareCall("begin ? := pkg.my_func(?); end;");

The problem is that I couldn't find a way to create a package in HSQLDB. 问题是我找不到在HSQLDB中创建包的方法。

Create a Schema with the PackageName eg 'pkg', so that the application code will make a call to the procedure with the name 'pkg.proc_name'. 使用PackageName创建一个模式,例如'pkg',以便应用程序代码将调用名称为'pkg.proc_name'的过程。 From Oracle's DB standpoint although 'pkg' meant but the statement will also work on HSQLDB as it will resolve 'pkg' to the schema and look for the procedure inside it. 从Oracle数据库的角度来看,虽然'pkg'意味着,但是该语句也将在HSQLDB上运行,因为它将把'pkg'解析为模式并在其中查找过程。

Package is in oracle extension, need not be supported by other database vendors. 软件包位于oracle扩展中,其他数据库供应商无需支持。 hsqldb does not support packages (it has 'AGGREGATE FUNCTION'. Is that of any use to you?) hsqldb不支持软件包(它具有“ AGGREGATE FUNCTION”。对您有什么用吗?)

You will have to move the business logic from package to a java code. 您将必须将业务逻辑从包移动到Java代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM