making CRUD operation with joined tables on JAVA