Neoview Guide to Stored Procedures in Java (R2.2)

A Sample SPJs
This appendix presents the SPJs that are shown in examples throughout this manual. The class
files that contain the SPJ methods use JDBC method calls to access a sample Neoview database.
For information about the sample database, see Appendix B (page 107).
“Procedures in the SALES Schema” (page 75)
“Procedures in the PERSNL Schema” (page 90)
“Procedures in the INVENT Schema” (page 98)
Procedures in the SALES Schema
The Sales class contains these SPJ methods, which are useful for tracking orders and managing
sales:
“LOWERPRICE Procedure” (page 76)
“DAILYORDERS Procedure” (page 78)
“MONTHLYORDERS Procedure” (page 80)
“TOTALPRICE Procedure” (page 82)
“PARTDATA Procedure” (page 84)
“ORDERSUMMARY Procedure” (page 88)
Those methods are registered as stored procedures in the SALES schema. Example A-1 shows
part of the code of the Sales.java source file. The rest of the code appears in the following
procedure sections.
Example A-1 Sales.java—The Sales Class
import java.sql.*;
import java.math.*;
public class Sales
{
public static void lowerPrice...
{
...
}
public static void numDailyOrders...
{
...
}
public static void numMonthlyOrders...
{
...
}
public static void totalPrice...
{
...
}
public static void partData...
{
...
}
Procedures in the SALES Schema 75