Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[ 1 0 : 0 6 , 3 0 / 0 1 / 2 0 2 4 ] Raghood : Assume that you have an

[10:06,30/01/2024] Raghood: Assume that you have an Oracle database schema named ebookshop, the ebookshop DB is located on 192.168.1.10 server. The ebookshop DB has several tables, including the Book table. The Oracle Schema DB user is ebookshop, whereas the DB password is pwd.
Notes:
The class OracleConnection is not fully written, you need to complete the missing parts -whenever necessary- so that you convert it into functioning code snippets.
Paste or upload the resulting new Java file as part of your answer below.
The file should contain no errors (errors are typically penalized)
//Write down the necessary imports in separate statements!
..............................
..............................
public class OracleConnection {
static final String DB_URL ="............................................................................................................";
static...
[10:06,30/01/2024] Raghood: Part 2: Design & Implementation
Given the Java class OracleConnection above. Based on the books table, Book Java class, and the BookCRUD Java interface below:
The UML class diagram for the class Book Java bean (class):
Book
- id: long
- title: String
- author: String
- double: price
- int: qty
+getId(): long
+setId(id: long): void
... the rest of getters and setters placed here
public interface BookCRUD {
int updateBook(Book b);//update existing book record.
}
Your task is to complete the BookCRUDOpertions Java class below so that you can save a book record to DB. Please take care of insertion status. You should also write a test case (i.e.1 line of code) that shows how to use BookCRUDOpertions from the main method.
Upload or paste the resulting Java file as part of your answer.
The file should contain no errors (errors are typically penalized)
public class BookCRUDOpertions implements BookCRUD{
public int updateBook(Book b){
int status =0;
try (----------------------------------------------
PreparedStatement pstmt =--------------------------------------;)
{
//Write down your code here to update the book object in DB.
} catch (SQLException se){
se.printStackTrace();
}catch (Exception e){
e.printStackTrace();
}
return status;
}
}

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

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions

Question

Have issues been prioritized?

Answered: 1 week ago

Question

un gerente de un Centro de Costo es evaluado usando

Answered: 1 week ago

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago