-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.java
47 lines (39 loc) · 1.45 KB
/
main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package org.SchoolManagement;
import org.SchoolManagement.core.Sync;
import org.SchoolManagement.decisions.Delete;
import org.SchoolManagement.decisions.Insert;
import org.SchoolManagement.decisions.Retrieve;
import java.sql.SQLException;
import java.util.Scanner;
public class main {
public static void main(String[] args) throws SQLException {
boolean looping = false;
boolean firstRun = true;
while (looping != true) {
System.out.println("Connecting to the database.....");
Sync.PrepareDatabase();
System.out.println("Connected");
System.out.println("---");
System.out.println("Welcome to the School Management System");
System.out.println("---");
System.out.println("Press 1 to retrieve details, or 2 to insert new details");
Scanner scan = new Scanner(System.in);
String ans = scan.next();
switch (ans.toLowerCase()) {
case "1":
Retrieve.GetDatabaseDetails();
break;
case "2":
Insert.InsertDatabaseDetails();
break;
case "3":
Delete.RemoveDetails();
break;
default:
System.out.println("Input not recognized");
System.out.println("---");
break;
}
}
}
}