전체 글
-
java에서 jpa 사용해보기 _ CRUD (JPA를 사용한 DML처리)JAVA/ORM 2024. 6. 19. 18:37
▤ 목차" data-ke-type="html">HTML 삽입미리보기할 수 없는 소스✔ 기본 환경설정resources 패키지에 META-INF와 logback.xml 파일을 생성하고 필요한 값을 설정해 줬다.META-INF 패키지 안에 persistences 파일을 생성하고 필요한 값을 설정해 줬다. //SangpumCRUD 클래스public class SangpumCRUD { public static void main(String[] args) { EntityManagerFactory emf = Persistence.createEntityManagerFactory("gojpa"); //Factory : 객체를 싱글톤으로 만들고있다. //EntityManager : thread ..
-
Jsoup 라이브러리 이용 : 데이터 웹 스크래핑 (서버에 접속 후 자료 읽기)JAVA/Network 2024. 6. 18. 12:45
▤ 목차" data-ke-type="html">HTML 삽입미리보기할 수 없는 소스✔ 웹 스크래핑(Scraping) VS 웹 크롤링 ⌨ 웹 스크래핑Scraping은 데이터 추출 기술이다. 웹 페이지 화명에서 데이터를 자동으로 추출하는 기법을 말한다.웹 사이트에 대한 스크래핑은 많은데, 웹 스크래핑은 특정 웹 사이트나 웹 페이지에서 원하는 데이터를 추출해 내는 것을 의미한다. 브라우저를 구동시켜 화면에 나오는 데이터를 수집한다.원하는 정보를 추출하기 전에 스크래퍼 봇이 사용된다. 이 도구를 통해 특정 웹 사이트에 콘텐츠를 다운로드하기 위해 HTTP BET요청을 보낸다. 이러한 도구는 사용자의 특정 요구 사항에 따라 구조적 또는 비구조적 형식으로 데이터를 추출한다.타깃을 분명히 하고 타깃에서 정보를 가져온다..
-
단위테스트 test case : 이클립스에서 Junit 사용법(+intellij)JAVA/기타 2024. 6. 17. 16:16
▤ 목차" data-ke-type="html">HTML 삽입미리보기할 수 없는 소스✔ 단위 테스트 Junit⌨ 단위 테스트란?유닛테스트라고 한다.단위 테스트는 하나의 모듈(기능 또는 메소드)을 기준으로 독립으로 진행되는 가장 작은 단위의 테스트를 말한다. 하나의 기능이 올바르게 동작하는지 독립적으로 테스트하는 것 통합 테스트는 실제 여러 컴포넌트들 간의 상호작용을 테스트하기 때문에 모든 컴포넌트들이 구동된 상태에서 테스트를 하게 된다. 단위 테스트는 해당 부분만 독립적으로 테스트하기 때문에 리팩토링시 문제 발생 여부를 확인할 수 있다. 장점테스팅에 대한 시간과 비용을 절감할 수 있다.새로운 기능 추가시 테스트가 가능하다.코드에 대한 설명이 될 수 있다.리팩토링 시 문제 발생 여부를 확인하여 안정성을 확보..
-
Apache와 Tomcat 개념과 다운받기Front/기타(웹서버) 2024. 6. 14. 16:06
▤ 목차" data-ke-type="html">HTML 삽입미리보기할 수 없는 소스✔ Apache🔷아파치란?Apache 웹 서버는 클라이언트(브라우저)로부터 HTTP 요청을 수신하고 해당 클라이언트에 HTTP 응답을 다시 전송하는 방식으로 전송하는 서버이다. HTTP 웹 서버로 불린다. ✨웹 서버란?웹 브라우저와 같은 클라이언트로부터 HTTP 요청을 받아들이고, HTML 문서와 같은 웹페이지를 반환하는 컴퓨터 프로그램이다. 웹서버라고한다. 웹 서버의 주된 기능은 웹 페이지를 클라이언트로 전달하는 것이다.하지만 클라이언트로부텉 콘테느를 전달 받는 것도 웹 서버의 기능에 속한다. https://apache.org/ Welcome to The Apache Software Foundation!Official..
-
스트림 생성 (collection , 배열)JAVA/스트림, 컬렉션 프레임워크, 람다 2024. 6. 13. 10:46
▤ 목차" data-ke-type="html">HTML 삽입미리보기할 수 없는 소스 ✔스트림 소개단어의 뜻은 '흐름'이다. 어떤 데이터의 흐름으로 유추해 볼 수 있다. 자바 8버전부터 추가된 컬렉션 요소를 하나씩 참조해서 람다식(함수적 인터페이스)으로 처리할 수 있도록 해주는 반복자를 의미한다.스트림 인터페이스는 컬렉션, 배열.. 등의 저장 요소를 하나씩 참조하여 인터페이스(람다식)을 적용하며 반복 처리가 가능하게 한다.반복자 역할을 한다.(internal iteration 내부 반복을 이용)정렬, 집계, 빅데이터 처리 등도 가능하다.1회용이기에 람다식과 많이 사용한다.내부 반복으로 작업 처리를 진행하며 원본 데이터를 변경하지 않는다.새로운 요소를 추가하는 것은 불가능하다.기존 요소 삭제는 불가능하다.무..
-
JWT란?web( jsp, servlet )/jsp 2024. 6. 11. 16:19
▤ 목차" data-ke-type="html">HTML 삽입미리보기할 수 없는 소스 https://hi-hahahoho.tistory.com/76세션과 쿠키에 대해 정리했었다. 그 연장선인 jwt를 정리해보고자 한다.세션과 마찬가지로 HTTP 기반이기에 (TCP/IP) 무상태인 환경에서 사용자와 데이터를 주고 받을 수 있도록 상태를 기억하는 기술이다. ✔ JWT(Json Web Token)로그인 기능은 보안에도 신경써야하고 사용자가 불편하지 않도록 신경써야 한다.회원가입시 로그인정보(ID,PW)를 바로 DB에 저장하고 로그인 시 맞춰보기만 했다면 보안상 위험하다.DB가 뚫리면 해당 정보는 전부 유출되기 때문이다.로그인 방식 또한 복잡하지만 로그인 상태를 유지하는 것도 여러 기술이 필요하다.jwt 또한..
-
java Swing 로그인 기능 queryJAVA/JDBC 2024. 6. 10. 15:24
▤ 목차" data-ke-type="html">HTML 삽입미리보기할 수 없는 소스 ✔ 로그인 기능👻발생 문제문제)사용자가 직원의 이름과 사번값을 입력 후 "로그인"버튼을 누르면모든 직원이 나오도록 해야한다. 발생문제 ) 데이터베이스에 없는 값(사번 혹은 이름)을 넣어도 전체 직원 목록이 나온다.sql문에 값이 잘못들어가면 테이블이 안나와야 정상이다.> 유효성 검사를 위해 if문을 사용했다.내 계획은 rs(resultSet)값이 null을 반환하면 null이 아닌 경우전체 직원 목록이 나오도록 하는 것이였다. 우선 sql문으로 다른 값이 들어가는 경우를 위해 임의의 값(아무값)을 넣었다. 당연하게 목록이 나오지 않았다. 계획에 맞춰 if문을 사용했다.if (true != rs.equals(null..
-
JWT import가 안되는 경우web( jsp, servlet )/jsp 2024. 6. 9. 13:33
jwt 복습을 하려는 와중 에러가 발생했다.왜 import가 뜨지 않지? 원래는 이와 같이 자동으로 import가 되어야한다. 예전에 기본 내장library가 없었던 적이 있어서 혹시 이번에도 이클립스가 잘못 깔린것인지 찾아봤다.먼저, io 파일을 열어봤다. j로 시작하는 파일들이 모두 없었다.그래서 따로 빌드를 해야하는 것인지 생각해봤다.해당 라이브러리를 다운받아야했나..딩동댕! 관련 파일들을 찾아서 다운받아 연습하면 된다.