티스토리 뷰
소스 코드
Login.java
package com.emp.domain; public class Login { // 아이디, 패스워드 // Field private String id_; private String pw_; private String newPw_; // Constructor public Login() { } public Login(String id_, String pw_) { this.id_ = id_; this.pw_ = pw_; } public Login(String id_, String pw_, String newPw_) { super(); this.id_ = id_; this.pw_ = pw_; this.newPw_ = newPw_; } // Getter public String getId_() { return id_; } public String getPw_() { return pw_; } public String getNewPw_() { return newPw_; } }
Region.java
package com.emp.domain; // 자료형 클래스 public class Region { // 지역번호, 지역명, 삭제가능여부 // Field private String regId; private String reg_name; private int count_; // Constructor public Region() { } public Region(String regId, String reg_name) { this.regId = regId; this.reg_name = reg_name; } public Region(String regId, String reg_name, int count_) { this.regId = regId; this.reg_name = reg_name; this.count_ = count_; } // Getter public String getRegId() { return regId; } public String getReg_name() { return reg_name; } public int getCount_() { return count_; } // Setter public void setRegId(String regId) { this.regId = regId; } public void setReg_name(String reg_name) { this.reg_name = reg_name; } public void setCount_(int count_) { this.count_ = count_; } // 출력 전용 메소드1 // -> 지역번호 / 지역명 public String print1() { String result = ""; result = String.format("%s / %s\n", getRegId(), getReg_name()); return result; } // 출력 전용 메소드2 // -> 지역번호 / 지역명 / 삭제가능여부 public String print2() { String result = ""; result = String.format("%s / %s / %d\n", getRegId(), getReg_name(), (getCount_() == 0) ? "O" : "X"); return result; } }
Department.java
package com.emp.domain; public class Department { // Field private String deptId; private String dept_name; private int count_; // Constructor public Department() { } public Department(String deptId, String dept_name) { this.deptId = deptId; this.dept_name = dept_name; } public Department(String deptId, String dept_name, int count_) { this.deptId = deptId; this.dept_name = dept_name; this.count_ = count_; } // Getter public String getDeptId() { return deptId; } public String getDept_name() { return dept_name; } public int getCount_() { return count_; } // Setter public void setDeptId(String deptId) { this.deptId = deptId; } public void setDept_name(String dept_name) { this.dept_name = dept_name; } public void setCount_(int count_) { this.count_ = count_; } // 출력 전용 메소드1 // -> 부서번호 / 부서명 public String print1() { String result = ""; result = String.format("%s / %s\n", getDeptId(), getDept_name()); return result; } // 출력 전용 메소드2 // -> 부서번호 / 부서명 / 삭제가능여부 public String print2() { String result = ""; result = String.format("%s / %s / %d\n", getDeptId(), getDept_name(), (getCount_() == 0) ? "O" : "X"); return result; } }
Job.java
package com.emp.domain; public class Job { // Field private String jobId; private String job_title; private int min_basicPay; private int count_; // Constructor public Job() { } public Job(String jobId, String job_title, int min_basicPay) { this.jobId = jobId; this.job_title = job_title; this.min_basicPay = min_basicPay; } public Job(String jobId, String job_title, int min_basicPay, int count_) { super(); this.jobId = jobId; this.job_title = job_title; this.min_basicPay = min_basicPay; this.count_ = count_; } // Getter public String getJobId() { return jobId; } public String getJob_title() { return job_title; } public int getMin_basicPay() { return min_basicPay; } public int getCount_() { return count_; } // Setter public void setJobId(String jobId) { this.jobId = jobId; } public void setJob_title(String job_title) { this.job_title = job_title; } public void setMin_basicPay(int min_basicPay) { this.min_basicPay = min_basicPay; } public void setCount_(int count_) { this.count_ = count_; } // 출력 전용 메소드1 // -> 직위번호 / 직위명 / 최소기본급 public String print1() { String result = ""; result = String.format("%s / %s / %,d\n", getJobId(), getJob_title(), getMin_basicPay()); return result; } // 출력 전용 메소드2 // -> 직위번호 / 직위명 / 최소기본급 / 삭제가능여부 public String print2() { String result = ""; result = String.format("%s / %s / %,d / %d\n", getJobId(), getJob_title(), getMin_basicPay(), (getCount_() == 0) ? "O" : "X"); return result; } }
Employee.java
package com.emp.domain; import java.sql.Date; public class Employee { // Field private String empId; private String name_; private String ssn; private Date hiredate; private String phone; private String regId; private String deptId; private String jobId; private String reg_name; private String dept_name; private String job_title; private int basicPay; private int extraPay; private int pay; // Constructor public Employee() { } public Employee(String empId, String name_, String ssn, Date hiredate, String phone, String regId, String deptId, String jobId, int basicPay, int extraPay) { this.empId = empId; this.name_ = name_; this.ssn = ssn; this.hiredate = hiredate; this.phone = phone; this.regId = regId; this.deptId = deptId; this.jobId = jobId; this.basicPay = basicPay; this.extraPay = extraPay; } public Employee(String empId, String name_, String ssn, Date hiredate, String phone, String reg_name, String dept_name, String job_title, int basicPay, int extraPay, int pay) { this.empId = empId; this.name_ = name_; this.ssn = ssn; this.hiredate = hiredate; this.phone = phone; this.reg_name = reg_name; this.dept_name = dept_name; this.job_title = job_title; this.basicPay = basicPay; this.extraPay = extraPay; this.pay = pay; } // Getter public String getEmpId() { return empId; } public String getName_() { return name_; } public String getSsn() { return ssn; } public Date getHiredate() { return hiredate; } public String getPhone() { return phone; } public String getRegId() { return regId; } public String getDeptId() { return deptId; } public String getJobId() { return jobId; } public String getReg_name() { return reg_name; } public String getDept_name() { return dept_name; } public String getJob_title() { return job_title; } public int getBasicPay() { return basicPay; } public int getExtraPay() { return extraPay; } public int getPay() { return pay; } // Setter public void setEmpId(String empId) { this.empId = empId; } public void setName(String name_) { this.name_ = name_; } public void setSsn(String ssn) { this.ssn = ssn; } public void setHiredate(Date hiredate) { this.hiredate = hiredate; } public void setPhone(String phone) { this.phone = phone; } public void setRegId(String regId) { this.regId = regId; } public void setDeptId(String deptId) { this.deptId = deptId; } public void setJobId(String jobId) { this.jobId = jobId; } public void setReg_name(String reg_name) { this.reg_name = reg_name; } public void setDept_name(String dept_name) { this.dept_name = dept_name; } public void setJob_title(String job_title) { this.job_title = job_title; } public void setBasicPay(int basicPay) { this.basicPay = basicPay; } public void setExtraPay(int extraPay) { this.extraPay = extraPay; } public void setPay(int pay) { this.pay = pay; } public String print1() { String result = ""; result = String.format("%s / %s / %s / %tF / %s / %s / %s / %s / %,d / %,d / %,d", getEmpId(), getName_(), getSsn(), getHiredate(), getPhone(), getReg_name(), getDept_name(), getJob_title(), getBasicPay(), getExtraPay(), getPay()); return result; } }
'IT 공부 in 교육센터 > JDBC_문제풀이' 카테고리의 다른 글
직원관리 v2.0 (CONSOLE+DATABASE) service (0) | 2018.09.10 |
---|---|
직원관리 v2.0 (CONSOLE+DATABASE) persistance (0) | 2018.09.09 |
직원관리 v2.0 (CONSOLE+DATABASE) 설계 (0) | 2018.09.08 |
성적관리 v2.4 (CONSOLE+DATABASE) (0) | 2018.09.05 |
성적관리 v2.0 (CONSOLE+DATABASE) (0) | 2018.09.04 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- git설치
- 번호자동증가
- Apache24
- ない형
- mysql 8.0
- た
- Database
- AH02102
- PreparedStatement
- 일본어 공부
- 버전 업그레이드
- 외부접속
- ない
- 성적관리
- oracle
- 직원관리
- Java
- 취업성공패키지
- て형
- git
- 동사 た
- JDBC
- 설치
- 저장소생성
- 동사의 활용
- 동사의활용
- た형
- 토비의스프링
- 초기설정
- 일본어
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함