Java Bean components, or Beans, are reusable software components that can be manipulated visually in a Java application development tool. Beans can be combined to create traditional applications and incorporated into Web applications as Java servlets.
When you generate, the following files are copied to the <VHI install folder>\projects\<ProjectName>\javabeans\src\<ProjectName>
directory, for each model and its associated procedures:
- <ProjectName>Session.java
- <ProcedureName>Filters.java
- <ProcedureName>Inputs.java
- <ProcedureName>Record.java
- <ProcedureName>RecordSet.java
The corresponding class files are located in the bld
directory.
Prior to using Verastream Java Beans for a production application:
<VHI install folder>\projects\<projectname>\javabeans
folder to the web server.
<VHI install folder>\lib\java\wcp.jar
<VHI install folder>\lib\java\vhiprop.jar
<VHI install folder>\lib\java\apptrieve.jar
<VHI install folder>\projects\<projectname>\javabeans\<projectname>.jar
This example illustrates how to use Web Builder generated Java Beans. The example
uses a project named CICSAccts_beans, which generated Java Beans for the CICSAccts
model. The GetAccount procedure takes an account number as an input parameter
and returns account information.
// Create an object to represent the session
CICSAccts_beans session = new CICSAccts_beansSession();
// Create a bean to hold the filter values
GetAccountFilters filters = new GetAccountFilters();
// Initialize the filters bean with the values you want to pass to the host
filters.setAcctNumber(new Integer (20000));
// Call the procedure on the session, passing in the filters
GetAccountRecordSet recordSet = session.getAccount(filters);
// Access the array of records and process through them
GetAccountRecord[] records = recordSet.getGetAccountRecords();
for (int i = 0; i < records.length; i++)
{
System.out.println(records[i].getAcctNum());
System.out.println(records[i].getLastName());
//...
}
© 1999-2007 Attachmate Corporation. All rights reserved. Terms of Use.