Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The following Courses ERD represents courses and sections as offered at UNB. This ERD applies to Questions 2 to 7 . UNB offers courses in
The following "Courses ERD" represents courses and sections as offered at UNB. This ERD
applies to Questions to
UNB offers courses in a wide variety of subject areas, including the subject area codes CS
MATH, and ENGL, just to name a few. Those three codes represent the subject areas named
Computer Science, Mathematics, and English, respectively.
Each course in UNB's Undergraduate Calendar is in exactly one subject area and has a course
title eg 'Introduction to Databases'
A section is an offering of a course that takes place during a specific academic term, such as
Winter represented in this database by the code W
The following partial textbased JDBC program is used to remove a section from the database.
Fill in the blanks to complete this program.
import java.sqlConnection;
import java.sqlDriverManager;
import java.sqlSQLException;
import java.sqlPreparedStatement;
import java.util.Scanner;
public class RemoveSection
public static void mainString args
Scanner scan new ScannerSystemin;
System.out.print
Enter the id of the section to be removed: ;
int sectionId scan.nextInt;
Connection connector DriverManager.getConnection
jdbc:mysql:cscsunb.ca:dbname
"userid", "PASSWORD";
String deleteText
PreparedStatement deleteStatement
connector.prepareStatementdeleteText;
deleteStatement.;
int affectedRows ;
if
System.out.println
Removal failed
;
else
System.out.println
Removal succeeded
;
connector.close;
end main
end RemoveSection class
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