Neoview Guide to Stored Procedures in Java (R2.3, R2.4)

SUPPLIERINFO Procedure
The SUPPLIERINFO procedure accepts a supplier number and returns the suppliers 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 DB Admin, and then enter or select these values
in the Create Procedure Wizard of DB Admin. For instructions, see “Uploading SPJ JAR Files to
the Neoview Platform” (page 35) and “Creating SPJs” (page 43).
supplierinfoName:
Inventory.jar > Inventory > supplierInfoCode:
Procedures in the INVENT Schema 101