A sample JDBC application is called from the database server to return multiple result sets.
A Java Development Kit (JDK) must be installed.
To create an external procedure, you must have the CREATE PROCEDURE and CREATE EXTERNAL REFERENCE system privileges. You must also have SELECT, DELETE, and INSERT privileges on the database object you are modifying.
Connect to the database from Interactive SQL.
Ensure the JDBCExample class has been installed.
For more information about installing the Java examples classes, see Preparing for the JDBC examples.
Define a stored procedure named JDBCResults that acts as a wrapper for the JDBCExample.Results method in the class.
CREATE PROCEDURE JDBCResults(OUT args LONG VARCHAR) DYNAMIC RESULT SETS 3 EXTERNAL NAME 'JDBCExample.Results([Ljava/sql/ResultSet;)V' LANGUAGE JAVA;
The example returns 3 result sets.
Set the following Interactive SQL options so you can see all the results of the query:
Click Tools » Options.
Click SQL Anywhere.
Click the Results tab.
Set the value for Maximum Number Of Rows To Display to 5000.
Click Show All Result Sets.
Call the JDBCExample.Results method.
Check each of the three results tabs, Result Set 1, Result Set 2, and Result Set 3.
Discuss this page in DocCommentXchange.
|Copyright © 2014, SAP AG or an SAP affiliate company. - SAP Sybase SQL Anywhere 16.0|