This section describes how to use included FairCom DB SQL Java classes to issue and process FairCom DB SQL statements in Java stored procedures. FairCom DB SQL Java classes are found in the ctreeSQLSP.jar file located in the <faircom>\server\classes directory of your FairCom DB installation.
To process FairCom DB SQL statements in a stored procedure, you need to know whether the SQL statement generates results (in other words, if the statement is a query) or not. SELECT statements, for example, generate results: they retrieve data from one or more database tables and return the results as rows in a table.
Whether a statement generates such an SQL result set dictates which FairCom DB SQL Java classes you use to issue it:
In either case, if you want to return a result set to the application, use the DhSQLResultSet class to store rows of data in a procedure result set. You must use DhSQLResultSet() methods to transfer data from an SQL result set to the procedure result set for the calling application to process it. You can also use DhSQLResultSet() methods to store rows of data generated internally by the procedure.
In addition, FairCom DB SQL provides the DhSQLException class so procedures can process and generate Java exceptions through the standard Java try { }, catch { }, and throw { } constructs.