JAVA using JDBC for SQL.
Thanks! Will thumbs up
(12 points) Q 5: Write a Java program that finds all prerequisites for a given using JDBC. The program should: course input using keyboard Takes a course id value as Finds the prerequisites of this course through a SQL query For each course returned, repeats the previous step until no new prerequisites can be found Prints the results. Don’t forget to handle the case for cyclic prerequisites. For example, if course A is prerequisite to course course B is prerequisite to course В, C, and course C is prerequisite to course A, do not infinite loop. Show transcribed image text (12 points) Q 5: Write a Java program that finds all prerequisites for a given using JDBC. The program should: course input using keyboard Takes a course id value as Finds the prerequisites of this course through a SQL query For each course returned, repeats the previous step until no new prerequisites can be found Prints the results. Don’t forget to handle the case for cyclic prerequisites. For example, if course A is prerequisite to course course B is prerequisite to course В, C, and course C is prerequisite to course A, do not infinite loop.
Expert Answer
Answer to (12 points) Q 5: Write a Java program that finds all prerequisites for a given using JDBC. The program should: course in…