Java Reference
In-Depth Information
method have already validated the content of the employee record. Another approach is to
include a validation method in this class and call from each of the four operations. Notice
that all operations dealing with the database are done through a PreparedStatement in order
to limit SQL inject attacks from the outside.
First, we get the largest employee number in order to create a new employee record with a
unique primary key. This way of getting an employee number may encounter a concur-
rency problem when another application or process inserts another record at the same
time; however, we ignore this condition here for the sake of simplicity.
Search WWH ::




Custom Search