Progress
Open Client
Developer’s Guide
The Java Client Application Using AccountInfo
The code in Example 5–3 demonstrates how to create and use AppObjects and ProcObjects from a Java client. In this example, the AppObject was defined with ProxyGen as Account.
Example 5–3: Java Client Using Proxy Objects
PayeeList Class for Example 5–3import java.sql.*; import java.util.Vector; /* An example of a simple implementation of payeeList INPUT result set. */ public class PayeeList extends com.progress.open4gl.InputResultSet { private Vector rows; private int rowNum; private Vector currentRow; // Create a payee result set with two payees. // Each has an Id and a name. PayeeList () { rows = new Vector(); Vector row; // {431, "Bay Plumbing"} payee. row = new Vector(); row.addElement(new Integer(431)); row.addElement(new String("Bay Plumbing")); rows.addElement(row); // {711, "Laura’s Gifts"} payee. row = new Vector(); row.addElement(new Integer(711)); row.addElement(new String("Laura’s Gifts")); rows.addElement(row); currentRow = null; rowNum = 0; } // Position the cursor on the next row. public boolean next() throws SQLException { try { currentRow = (Vector)rows.elementAt(rowNum++); } catch (Exception e) {return false;} return true; }
Example 5–4: Java Input ResultSet ExampleThe following procedure supports a small portion of an accounting system. The
AccountInfo.p
procedure is expected to run persistently and has an internal procedure calledgetPaymentsInfo
.
Example 5–5: AppServer Application
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |