CS MySQL question
CS-3200 Homework 7
Executing SQL statements from an application program
This assignment gives you an opportunity to practice writing code that connects to a MySQL database and executes queries from an application program driven by input from a user. We prefer you code this assignment in one of the supported host languages but will accept application code written in any of the languages approved for the project.
Coding connectivity to a MySQL database is an important initial step in programming your project. Please take advantage of the connectivity starter files for Java, python, php, and R found in blackboard. Please submit one zip file to blackboard containing the application code and a dump of
your database for the assignment using the course naming protocol. When submitting the assignment, add a note to the submission stating the programming language used to code the assignment.
1) (10 points) Prompt the user for the MySQL username and password.
2) (15 points) Use the user provided username and password values to connect to the lotrfinal (schema from homework 4) database.
3) (10 points) Prompt the user to enter a particular character name. Store the result in a variable.
4) (20 points) Have your application code do data validation on the input provided by the user. We expect your data validation will be driven by the character names stored in the database. You should retrieve the list of characters before prompting the user for a character name in order to simplify the data entry process and guide the input using the legal list of character names.
5) (20 points) Use the name as an argument to the function track_character( ). Call the procedure.
6) (20 points) Print the result set of track_character to standard output.
7) (5 points) Generate an error message to standard output and re-prompt the user for input, if the user provides invalid input.
8) (10 points) Once the records are written to standard output, close the connection to the database and end the application program.