Show TOC Start of Content Area

Procedure documentation Creating an SQLJ ResultSet Iterator  Locate the document in its SAP Library structure

Use

To process the data from the table TMP_EMPLOYEE, you need to create an SQLJ result set iterator. This named iterator enables the access to the result set columns using named getter methods.

Prerequisites

You must have created the GettingStartedOpenSQLWeb project.

Procedure

 

...

       1.      In the Java perspective, select GettingStartedOpenSQLWeb project and open its context menu.

       2.      Choose New Other… Choose Persistence in the left-hand pane and SQLJ Source in the right-hand pane.

       3.      Choose Next.

       4.      Enter EmployeeIter in the Name field. To choose a package, use Browse… next to the Package field, and choose temp.persistence.gettingstarted.dao from the list.

       5.      Choose Finish.

       6.      The SQLJ file opens automatically after it has been created. Enter the following code:

Example

package temp.persistence.gettingstarted.dao;

 

#sql iterator EmployeeIter(int EMPID, String FIRST_NAME, String LAST_NAME, java.math.BigDecimal SALARY);

 

       7.      Save and close the file.

Result

You can now implement the data access interface with SQLJ.

 

 

End of Content Area