Java Reference
In-Depth Information
3.
Change Shipment's getFieldsFromRS method to check if the shipment was found in the
database. If the shipment is not in the database, display the following message (where the
actual shipment number is display instead of xxxxx) in the Console:
Shipment number xxxxx does not exist in the database.
4.
In EnterShipNum, check if the shipment was retrieved from the database and if not, do not
display ShipmentFrame.
There are several reasons the shipment information is not displayed correctly:
A.
The first label is too small.
B.
If a string value does not fill a table's column, the database “pads” the value with
blanks.
(In other words, if the month value is 4, the retrieved value will be “4 ” - the character 4 followed by a blank
space. This results in the spacing being “off ”. In addition, because of the blank space, trying to parse “4” will result
in a number format exception being thrown.)
5.
Change the Shipment class's getFieldsFromRS method so that the fields RcvDate and
RcvTime are built and use the String class's trim method on all the data fields retrieved
from the result set that may be padded with spaces.
6.
Change the Shipment class's setRcvDate(String) and setRcvTime(String) methods so that
the six individual properties (hour, minute, day, month, etc.) values are also set.
7.
In ShipmentFrame, make the first label wider so that all the text will appear.
Check that the Exercise Was Done Correctly
Perform the same tests as were done for the Review Exercise and confirm that the problems have been resolved.
 
Search WWH ::




Custom Search