Answered step by step
Verified Expert Solution
Question
1 Approved Answer
package osu.cse 3 2 4 1 . options; import java.util.Arrays; import java.util.HashSet; import java.util.Scanner; import java.util.Set; import osu.cse 3 2 4 1 . utilities.Utilities; import
package osu.cseoptions;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
import osu.cseutilities.Utilities;
import osu.csesqlSQL;
import osu.cseGRS;
public class EditMenu
private static final Set MENUOPTIONS new HashSetArraysasListx;
public static void menuScanner cin
Utilities.printDivider;
System.out.printEDIT MENU:
Add Artist
Delete Artist
Update Artist
"Input numerical selection or x to quit: ;
String input cin.nextLine;
char selection input.isEmpty input.charAt : ;
whileMENUOPTIONS.containsselection
System.out.printIncorrect option specified! Try again: ;
input cin.nextLine;
selection input.isEmpty input.charAt : ;
switchselection
case :
addArtist;
break;
case :
deleteArtist;
break;
case :
updateArtist;
default:
break;
PART SEVEN:
Complete the method addArtist below and remove its placeholder.
Your implementation will follow the general procedure:
Prompt the user for values for each column in the ARTIST table.
Call a method in SQLjava which will handle the insertion of data
via PreparedStatement and will print out a confirmation message
upon successful insertion. You will need to define this method in SQLjava!
Note: since this query is not returning anything like a SELECT query we need to use
a different method here see JDBCAPI slide deck: PreparedStatement.executeUpdate This also has the possibility to
throw a SQL Exception like many other methods you have already used so make sure it is
handled in much the same way as the other StatementPreparedStatement methods are handled!
You are free to design the input prompt, and the method on SQLjava to insert the data, etc.
private static void addArtist
Utilities.placeholder;
TODO
private static void deleteArtist
Utilities.placeholder;
private static void updateArtist
Utilities.placeholder;
fill in the todo
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started