Neoview Guide to Stored Procedures in Java (R2.5)
public static void partLocations(int partNum,
int quantity,
ResultSet exactly[],
ResultSet moreThan[])
throws SQLException
{
Connection conn = DriverManager.getConnection("jdbc:default:connection");
PreparedStatement getLocationsExact = conn.prepareStatement(
" SELECT L.loc_code, L.partnum, L.qty_on_hand " +
" FROM invent.partloc L " +
" WHERE L.partnum = ? " +
" AND L.qty_on_hand = ? " +
" ORDER BY L.partnum ");
getLocationsExact.setInt(1, partNum);
getLocationsExact.setInt(2, quantity);
PreparedStatement getLocationsMoreThan = conn.prepareStatement(
" SELECT L.loc_code, L.partnum, L.qty_on_hand " +
" FROM invent.partloc L " +
" WHERE L.partnum = ? " +
" AND L.qty_on_hand > ? " +
" ORDER BY L.partnum ");
getLocationsMoreThan.setInt(1, partNum);
getLocationsMoreThan.setInt(2, quantity);
exactly[0] = getLocationsExact.executeQuery();
moreThan[0] = getLocationsMoreThan.executeQuery();
} // See the “PARTLOCS Procedure” (page 99).
}
See the following sections for more information about each SPJ method.
Procedures in the INVENT Schema 93