Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA PROGRAMMING create a CRUD application for a Book database (bookdb) with two tables. Author table AuthorID (number, PK) FirstName (varchar(30), not null) LastName (varchar(30),

JAVA PROGRAMMING

create a CRUD application for a Book database (bookdb) with two tables.

Author table

  • AuthorID (number, PK)
  • FirstName (varchar(30), not null)
  • LastName (varchar(30), not null)

Book table

  • ISBN (number, PK)
  • Title (varchar(50), not null)
  • AuthorID(number, foreign key, not null)
  1. Write a SQL code to create these two tables in a dummy database using NetBeans JavaDB network server (name your database testauthorbookdb). Put your screenshots showing that these two tables are created successfully by running your SQL code. 5 points.
  2. Insert 3 different authors and 3 books related to those authors you added. Show your work. 5 points.
  3. Try to add an existing author and an existing book into database. Show primary key violation. 5 points.
  4. Try to add a new book into database for an author that does not exist in your database. Show foreign key violation. 5 points.
  5. Put those SQL code in a file named as V1_something.sql, V2_something.sql under db.migrations so you can create those tables via FlyWay. Try to give meaningful names to your SQL files. Show your work. 5 points.
  6. Name your database as authorbookdb so FlyWay will create a databasefolder as authorbookdb. Hint: check DB.java. Put screenshot of your DB.java. 5 points.
  7. Modify entity classes. Put screenshot of your Author.java and Book.java. 5 points each.
  8. Modify entityDAO classes. Put screenshot of your AuthorDAO.java and BookDAO.java. 5 points each. (If you modified DAO.java, put screenshot of that one too.)
  9. Modify the main method to test your CRUD application for the following tasks. If your application does not run, you will get zero points for this part. Show your work by putting screenshots from your running application. 5 points for each task.
    • Add 3 of your favorite Authors.
    • Add one of your favorite books from each author.
    • Pick one author and update his/her first name.
    • Pick one book and update its title.
    • Pick one book and update its authorid to a non-existing author (foreign key violation).
  10. Modify the main method (keep the previous code from task 9) to add a user input logic for your CRUD. So user can perform CRUD operations on two tables. 2.5 points for each task (except option 9).
    • Option 1,2,3,4 for CRUD on Author table.
    • Option 5,6,7,8 for CRUD for Book table.
    • Option 9 for Exit (5 points).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 23rd International Conference Dexa 2012 Vienna Austria September 2012 Proceedings Part 1 Lncs 7446

Authors: Stephen W. Liddle ,Klaus-Dieter Schewe ,A Min Tjoa ,Xiaofang Zhou

2012th Edition

3642325998, 978-3642325991

More Books

Students also viewed these Databases questions