-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMainClass.java
41 lines (35 loc) · 1.01 KB
/
MainClass.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
package com.employ.jdbc;
import java.io.BufferedReader;
import java.util.*;
import java.io.InputStreamReader;
import com.employee.jdbc.controller.employeedetails;
public class MainClass {
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
employeedetails employeeController = new employeedetails();
int choice, choice1;
boolean choice0 = true;
Scanner sc=new Scanner(System.in);
while (choice0) {
System.out.println("Choose Operation : \n 1. Add an Employee \n 2. Get an Employee" + "\n 3. Exit");
System.out.println("Select a option");
choice=sc.nextInt();
switch (choice) {
case 1:
employeeController.create();
break;
case 2:
employeeController.get();
break;
case 3:
System.exit(0);
break;
default:
System.out.println("Invalid input");
}
System.out.println("Do you still wanna operate? Press 0 to exit.");
choice1=sc.nextInt();
choice0 = choice1==0 ? false : true ;
}
}
}