Home / Expert Answers / Computer Science / using-java-create-a-new-java-project-in-intellij-called-assignment10-place-the-mccschedule-db-fil-pa456

(Solved): USING JAVA:- Create a new java project in IntelliJ called Assignment10. Place the MCCSchedule.db fil ...



USING JAVA:

- Create a new java project in IntelliJ called Assignment10.

  • Place the MCCSchedule.db file inside your project folder
  • Place the JDBC driver file inside your project folder

- Create the following java files in your project to use for this assignment:

  • ScheduleSystem.java - the "visual" class that has the main method and will have the menus to search, add, etc.
  • ScheduleDB.java - the database class that will hold on the methods to connect, search, add, etc.
  • Other files to help you - these are optional, a little freedom here if you need other classes.

----------Part 1: Setting Up the Database and Connection----------

Set up a connection to the database file using the SQLite JDBC driver provided.

You should then code a method that gets your connection to the database to use in the other methods you create. Test it out and make sure you get a connection.

You should create a database object in the ScheduleSystem.java file to be able to call methods on.

You should setup a base menu like the following for people to choose from. Then use a switch to call methods that perform said operations. (Method coding for each in each part below)

1. Search for Class
2. Add a class
3. Delete a class Operation:

----------Part 2: Search through available classes----------

We have a lot of different things that we can search for in this database. We can see if classes are at a specific campus, date/time, specific department/class, and instructor. We need to provide all of those options to the user to search through the database.

You should provide a menu something like this that the user can choose from, then get input and query the database based on input. Remember to use prepared statements.

1. Class Name
2. Days of the Week
3. Department
4. Instructor
5. Campus
Search option:

----------Part 3: Add and Delete---------

-Add a class

  • We need to be able to add to the schedule. To do this prompt for the required data (Course ID, Section, Campus, Dates and Times, etc.) then attempt to add it into the table. The problem here is that it is a little tougher to check for duplicates. The primary key for the schedule table is just an integer that counts up. What we need to do is check to see if the class is already in the schedule. To do that we need to check against the Course ID and the section. Those two things are unique to the class. So do some querying and see if it is in the list before adding. Otherwise we will have duplicates and no one would ever know. Again make sure to use prepared statements.

-Delete a class

  • Deleting a class should be pretty easy. To delete we should have the user enter in the Course ID and the section. Those are some unique identifiers that we can use and if found delete. If you remember in SQL you have the 'and' keyword that can check multiple values to be true. You will want to do that because some sections repeat themselves across different departments. This should use prepared statements here as well.

----------MCCSchedule.db info----------

File Edit View Tools Help

File Edit View Tools Help
New Database
Open Database
Write Changes
????Revert Changes
Open Project
Save Project
Attach Databa

1. Search for Class 2. Add a class 3. Delete a class Operation: 1. Class Name 2. Days of the Week 3. Department 4. Instructor 5. Campus Search option: File Edit View Tools Help File Edit View Tools Help New Database Open Database Write Changes ????Revert Changes Open Project Save Project Attach Database Close Database Database Structure Browse Data Edit Pragmas Execute SQL Table: Schedule Filter in any column


We have an Answer from Expert

View Expert Answer

Expert Answer



Step-1:-

The question is asking you to create a Java program that interacts with a SQLite database. You will need to create a new Java project in IntelliJ called Assignment10 and place two files, MCCSchedule.db and the SQLite JDBC driver file, inside your project folder.

You will need to create two Java files, ScheduleSystem.java and ScheduleDB.java, to handle the visual aspect and database connection respectively. You may also need to create additional Java classes if needed.
The program should have a menu that allows the user to choose between searching for a class, adding a class, or deleting a class.

For the search feature, the program should allow the user to search for classes based on various criteria such as class name, days of the week, department, instructor, and campus. The program should use prepared statements to perform the queries.

For the add feature, the program should prompt the user for information about the class such as Course ID, section, campus, dates and times, etc. The program should then check if the class is already in the schedule before adding it to the database to prevent duplicates.


For the delete feature, the program should prompt the user for the Course ID and section of the class they want to delete and then delete it from the database.

The MCCSchedule.db file contains a table called Schedule with various fields such as Course ID, section, class name, instructor, campus, dates and times, etc.
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe