Java implementation of database additions and deletions