Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package projectSamples;
- import java.util.Scanner;
- public class Day26EmpA {
- //para sa insert
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- Day26Emp callQuery = new Day26Emp();
- String fName, lName, dept, phone, sex, bday;
- double salary;
- int rowsAffected = 0;
- System.out.println("***Add new employee***");
- //nilagay sa try catch para pag may maling input, di tutuloy
- try {
- System.out.print("First Name: ");
- fName = sc.nextLine();
- System.out.print("Last Name: ");
- lName = sc.nextLine();
- System.out.print("Dept(ADG/XVN/RTG): ");
- dept = sc.nextLine();
- System.out.print("Phone: ");
- phone = sc.nextLine();
- System.out.print("Sex: ");
- sex = sc.nextLine();
- System.out.print("Salary: ");
- salary = sc.nextDouble();
- sc.nextLine();
- System.out.print("Birthday(YYYY-MM-DD): ");
- bday = sc.nextLine();
- rowsAffected = callQuery.addNewEmployee(fName, lName, dept, phone, sex, salary, bday);
- } catch (Exception e) {
- }
- if (rowsAffected == 1) {
- System.out.println("New Employee Recorded");
- } else {
- System.out.println("Record Failed");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment