2023.11.21-2024.05.31(238)
-
231227 JAVA EmployeesDAO
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 47 48 49 package com.sukgi.dao; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import com.sukgi.dto.EmployeesDTO; import conn.sukgi.db.DBConnecti..
2023.12.27 -
231227 JAVA EmployeesDTO
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 com.sukgi.dto; public class EmployeesDTO { private int emp_no; private String birth_date, first_name, last_name, gender, hire_date; public int getEmp_no() { return emp_no; } public void setEmp_no(int emp_no) { this.emp_no = emp_no; } public String getBirth_date..
2023.12.27 -
231227 JAVA DBConnection
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 package conn.sukgi.db; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; //접속 정보만 가지고 있는 클래스 public class DBConnection { public Connection getConn() {// 메소드 정의 Connection connection = null;// 변수 선언, 초기화 try {// 드라이버 로드 및 연결 정보 설정 Class.forName("org.mariadb.jdb..
2023.12.27 -
231226 JAVA EmployeesDTO
package com.sukgi.db; //데이터 전송 객체 public class EmployeesDTO { //값을 담을 변수 private String dept_no, dept_name;// private int emp_no; private String birth_date,first_name, last_name,Hire_date; private String gender; //getter / setter method-> source에서 생성 public String getDept_no() { return dept_no; } public void setDept_no(String dept_no) { this.dept_no = dept_no; } public String getDept_name() { re..
2023.12.27 -
231226 JAVA Test
package com.sukgi.db; import java.util.List; public class Test { public static void main(String[] args) { EmployeesDAO dao = new EmployeesDAO(); List result = dao.selectDepartments(); for (int i = 0; i
2023.12.27 -
231226 JAVA EmployeesDAO
package com.sukgi.db; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; //데이버 접속 객체(Data Access Object public class EmployeesDAO { DBConnection dbConn = new DBConnection(); public List selectEmployees() { List result = null; // 접속 정보 Connection con = dbConn.getConnection(); //..
2023.12.26