Goal
This document describes how to execute VQL statements from a stored procedure created with Java.
Note that, if the use of a Java stored procedure is not required by some additional implementation needs, like using some specific Java library or functionality, it is recommended to use VQL stored procedures for most implementations of procedural logic.
Content
One of the main functionalities when developing a stored procedure is the possibility of executing a VQL statement to execute queries and perform CRUD operations on the Virtual DataPort database where the stored procedure is being executed.
To do so the stored procedures have a method:
public void initialize(DatabaseEnvironment environment)
that is executed when the stored procedure is initialized and can be implemented to obtain a reference to a DatabaseEnvironment object. The database environment object represents the VDP database where the stored procedure is being executed and it provides the following methods:
- ResultSet executeQuery(java.lang.String query): to execute SELECT statements.
- int executeUpdate(java.lang.String query): to execute CRUD operations.
More information about these methods and the DatabaseEnvironment object is available in the API documentation:
- Online API Documentation
- <DENODO_HOME>/docs/vdp/api/index.html
References
The information provided in the Denodo Knowledge Base is intended to assist our users in advanced uses of Denodo. Please note that the results from the application of processes and configurations detailed in these documents may vary depending on your specific environment. Use them at your own discretion.
For an official guide of supported features, please refer to the User Manuals. For questions on critical systems or complex environments we recommend you to contact your Denodo Customer Success Manager.