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

Using Unnamed Parameters............................................................................................................55
Returning Result Sets in NCI...........................................................................................................55
Calling SPJs From an ODBC Client Application..................................................................................56
Returning Result Sets in an ODBC Client Application...................................................................56
Calling SPJs From a JDBC Client Application......................................................................................57
Returning Result Sets in a JDBC Client Application.......................................................................58
Calling an SPJ in a Trigger....................................................................................................................59
8 Performance and Troubleshooting..............................................................................61
Troubleshooting Common Problems....................................................................................................61
Performance Tip....................................................................................................................................62
Displaying an Execution Plan of a CALL Statement............................................................................62
Using the EXPLAIN Statement.......................................................................................................62
Using the EXPLAIN Function.........................................................................................................63
A Sample SPJs..................................................................................................................65
Procedures in the SALES Schema.........................................................................................................65
LOWERPRICE Procedure................................................................................................................69
Java Method: lowerPrice()..........................................................................................................69
Creating the Procedure: LOWERPRICE....................................................................................69
Calling the Procedure: LOWERPRICE.......................................................................................70
DAILYORDERS Procedure..............................................................................................................71
Java Method: numDailyOrders()...............................................................................................71
Creating the Procedure: DAILYORDERS...................................................................................71
Calling the Procedure: DAILYORDERS.....................................................................................72
MONTHLYORDERS Procedure......................................................................................................73
Java Method: numMonthlyOrders()..........................................................................................73
Creating the Procedure: MONTHLYORDERS...........................................................................73
Calling the Procedure: MONTHLYORDERS.............................................................................74
TOTALPRICE Procedure.................................................................................................................75
Java Method: totalPrice()............................................................................................................75
Creating the Procedure: TOTALPRICE......................................................................................75
Calling the Procedure: TOTALPRICE........................................................................................76
PARTDATA Procedure....................................................................................................................77
Java Method: partData().............................................................................................................77
Creating the Procedure: PARTDATA.........................................................................................78
Calling the Procedure: PARTDATA...........................................................................................79
ORDERSUMMARY Procedure........................................................................................................81
Java Method: orderSummary()..................................................................................................81
Creating the Procedure: ORDERSUMMARY............................................................................82
Calling the Procedure: ORDERSUMMARY...............................................................................82
Procedures in the PERSNL Schema......................................................................................................83
ADJUSTSALARY Procedure...........................................................................................................85
Java Method: adjustSalary().......................................................................................................85
Creating the Procedure: ADJUSTSALARY................................................................................85
Calling the Procedure: ADJUSTSALARY..................................................................................86
EMPLOYEEJOB Procedure..............................................................................................................87
Java Method: employeeJob()......................................................................................................87
Creating the Procedure: EMPLOYEEJOB..................................................................................87
Calling the Procedure: EMPLOYEEJOB.....................................................................................87
PROJECTTEAM Procedure.............................................................................................................89
Java Method: projectTeam().......................................................................................................89
Creating the Procedure: PROJECTTEAM..................................................................................89
Table of Contents 5