Neoview Guide to Stored Procedures in Java (R2.3, R2.4)
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 109).
• “Procedures in the SALES Schema” (page 77)
• “Procedures in the PERSNL Schema” (page 92)
• “Procedures in the INVENT Schema” (page 100)
Procedures in the SALES Schema
The Sales class contains these SPJ methods, which are useful for tracking orders and managing
sales:
• “LOWERPRICE Procedure” (page 78)
• “DAILYORDERS Procedure” (page 80)
• “MONTHLYORDERS Procedure” (page 82)
• “TOTALPRICE Procedure” (page 84)
• “PARTDATA Procedure” (page 86)
• “ORDERSUMMARY Procedure” (page 90)
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 77