Answered step by step
Verified Expert Solution
Question
1 Approved Answer
can you please help me complete this al Add Dog: Write a stored procedure to add a dog. Pass 5 parameter values: owner s ID
can you please help me complete this al
Add Dog:
Write a stored procedure to add a dog. Pass parameter values: owners IDdate of birth, name, breed, and weight. Use a sequence to generate an ID for the dog being added.
Add Owner :
Write a stored procedure to add an owner. Pass four parameter values: first name, last name, phone, and starting balance. Use a sequence to generate an ID for the owner being added.
Add Walker:
Write a stored procedure to add a walker. Pass five parameter values: first name, last name, phone, balance, and commission rate the percentage of an appointment charge that goes to this walker
The procedure will set the walkers status to active. Use a sequence to generate an ID for the walker being added.
Extend the Java client to support the commands described below. The commands are simplified to minimize development time and effort. The Java interface will not provide any functionality to look up IDs. Users know dog, owner, and walker IDs. some parameters will be entered using name:value pairs to increase usability and flexibility.
Tip Walker:
Add a command to the Java user interface enabling a customer to give a walker a tip. Implement all functionality in Java. Handle all expected exceptions and display a meaningful error message for each failure.The name of the command is tip. The command takes three parameters: the ID of the walker to be tipped, the ID of the owner giving the tip, and the amount of the tip. The command below gives walker a tip of five dollars and fifty cents from owner
tip owner:tip:
Add Dog:
Add a command to the Java user interface enabling a customer to add a dog. The user interface must use the stored procedure to add the dog. the name of the command is add. The first parameter is dog specifying the user wants to add a dog. The add command will enable users to add other entities, including owners and walkers. For this assignment, you will only implement the command to add a dog.
Five additional parameters are passed with the following names: owner, dob, name, breed, and wtSpecifying the parameters with name:value pairs enables the parameters to be passed in any order.
The command below adds a dog named Tramp, a mixed breed, born on March weighing pounds owned by owner ID
add dog name:Tramp dob:Marbreed:mixed wt:ownerID:
Update Dog Weight:
Add a command to the Java user interface enabling a customer to adjust the weight of their dog. implement all functionality in Java.
The name of the command is upd. The first parameter is wt followed by two parameters with names: dogID and wt
The command below changes Dinos weight to pounds
upd wt dogID: wt:
Important Requirements:
Isolate the code that parses the commands and parameters. Write simple, reusable functions with a single responsibility. Test functions that process commands, but are not required to automate tests to process commands. The Java client never directly accesses a base table. create all objects, including sequences and views, in the dwcreate script. You may extend the scripts you are given, but you may not change any code in the given scripts.
Customers frequently tip their walker, but dogs are rarely added to the system. Use the appropriate JDBC statements.
Inserts, updates, and deletes only occur in a transaction. All transactions must end with a commit or rollback.
Testing:
Develop a PLSQL test driver to test your stored procedures and develop a Java test driver to test the user interface.
Each test case must be independent. You may be tempted to develop a test case that depends on a previous test case. Creating a dependency should raise a red flag. Developing test cases that depend on previous test cases minimizes development time but creates challenges when a single test case must be executed to troubleshoot a problem.
Each test case has three sections: setup, test, cleanupThe setup section resets all objects used by the test. For example, the test should start with an empty schema, load static data as necessary, and reset sequences. The state of the database must be known before the test is executed.
The test section executes the test case, verifies the results, and determines if the test case passed or failed.
The cleanup section reverses the setup and the test execution. For ex the cleanup section might truncate all tables.
Do not duplicate code. The setup and cleanup sections may call functions and procedures egtruncate tables
Each test case should output a unique numeric test case number and either PASS or FAIL. A high quality test driver would also produce a report summarizing the num of test cases that passed, the num that failed, and the ID of each test case that failed.
Keep test driver simple, but effective. Think ab dependencies and avoid them. For ex resetsequences to ensure ID numbers are consistent across multi. exec of test drv pls look at pictures.
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