Neoview Guide to Stored Procedures in Java (R2.5)
SUPPLIERINFO Procedure
The SUPPLIERINFO procedure accepts a supplier number and returns the supplier’s name,
street, city, state, and post code to separate output parameters.
Java Method: supplierInfo()
Example A-14 supplierInfo() Method
public static void supplierInfo(BigDecimal suppNum,
String[] suppName,
String[] streetAddr,
String[] cityName,
String[] stateName,
String[] postCode)
throws SQLException
{
Connection conn = DriverManager.getConnection("jdbc:default:connection");
PreparedStatement getSupplier =
conn.prepareStatement("SELECT suppname, street, city, " +
" state, postcode " +
"FROM invent.supplier " +
"WHERE suppnum = ?");
getSupplier.setBigDecimal(1, suppNum);
ResultSet rs = getSupplier.executeQuery();
rs.next();
suppName[0] = rs.getString(1);
streetAddr[0] = rs.getString(2);
cityName[0] = rs.getString(3);
stateName[0] = rs.getString(4);
postCode[0] = rs.getString(5);
rs.close();
conn.close();
}
Creating the Procedure: SUPPLIERINFO
To create this procedure in the INVENT schema, upload the Inventory.jar file to the Neoview
platform, navigate to the INVENT schema in HPDM, and then enter or select these values in the
Create Procedure dialog box of HPDM. For more information, see the HP Database Manager
(HPDM) User Guide.
supplierinfoName:
Inventory.jar > Inventory > supplierInfoCode:
94 Sample SPJs