전체 글
-
1013. [mongoDB] 인증 (수정 중)DB/mongoDB 2023. 10. 13. 14:43
인증된 사용자만 쓸 수 있도록 하기 시작은 비인증모드 : 기본사용자를 먼저 추가하고 인증모드로 바꿔야 한다. 1. //관리자 만들기 use admin //user:'root' = user:'admin', 권한은 배열로 처리한다. db.createUser({user:'admin', pwd:'1234', roles:['root']}) //DB별 일반 유저 만들기 use shop db.createUser({user:'user01', pwd:'1234', roles:['readWrite']}) 세팅이 완료되면 DB에서 우클릭해서 Disconnect 해 준다. 2. VS code를 열어 cfg 파일 설정 ❗앞에 두 번 띄우고 타이핑 이렇게 떠도 창 닫고 다시 열어보면 저장 잘 되어있다. 서비스 열어서 MongoD..
-
1012. [MongoDB] NoSQL 입문DB/mongoDB 2023. 10. 12. 14:59
oracle과 같은 RDBMS이고 컬럼에서 정해진 거 외엔 저장할 수 없는 "정형데이터" (형태없는 건 비정형데이터) *RDBMS는 비정형보다 정형데이터를 다룰 때 편하다 🖤MongoDB를 쓰는 이유 1. 고정된 스키마가 없다. "flexible schema" 스키마(데이터의 논리적 구조-테이블의 형태)가 자주 바뀌는 환경에서 유용 스키마가 고정되어있지 않아 어떠한 테이블의 형태도 사용할 수 있다. "다양한 형태의 테이블 사용" 2. 분산 컴퓨팅 환경 샤딩과 복제가 default로 설정되어 있다. "고가용성" 3. 임의의 추가적인 인덱스를 설정할 수 있다. 4. in memory로 메모리에 올려두며 사용해서 처리속도가 빠르면서 메모리 사용량이 늘어나 단점이기도 하다. ⭐분산 컴퓨팅 환경이란? *네트워크 ..
-
1012. MongoDB와 Studio 3T 설치 방법DB/mongoDB 2023. 10. 12. 10:57
🍃MongoDB 설치 https://www.mongodb.com/try/download/community Try MongoDB Community Edition Try MongoDB Community Edition on premise non-relational database including the Community Server and Community Kubernetes Operator for your next big project! www.mongodb.com 1. 해당 사이트에서 Community Server의 하단 녹색 [Select package] 클릭 2. 다운로드 버전 선택 3. 설치된 msi 프로그램 실행 [Next] 4. 라이센스 동의 후 [Next] - Complete으로 진행 5. 외..
-
1004. BS4 Carousel로 홈페이지에 이미지 삽입하기카테고리 없음 2023. 10. 4. 17:32
tavel_img_random.sql 파일 -- mysql 의 이미지 랜덤 섞기 select * from travel order by rand() limit 5; 쿼리 실행할 때마다 다르게 섞인다. 랜덤 이미지 뽑기 domain의 travelVO에 해당 코드 입력 0~4 범위이므로 +1하기. %03d : 001 번, 002번,, 등을 말함 no : 1이면 %03d로 볼 때 001로 취급 i : 앞의 %d에 해당 TravelVO package org.galapagos.domain; import java.util.ArrayList; import java.util.List; import java.util.Random; import javax.validation.constraints.NotBlank; impor..
-
0926. 답글 처리(서버 + 클라이언트)Spring 2023. 9. 27. 17:42
보호발행인데 왜 보이지.. 🌱 서버 - REST API 컨트롤러 만들어서 @RestController 사용 - RequestBody : 모델객체 만들 때 application/json 파일 복원 클라이언트 - Ajax : $.ajax() promise 객체 / fetch() async/await 📍서버 측 설계 비버 열어서 comment에 대한 foreign key 를 cno로 등록하기 필수요소 : cno, content, writer tbl_reply 답글 테이블 생성 tbl_reply.sql drop table if exists tbl_reply; create table tbl_reply ( no integer auto_increment primary key, cno integer not null, ..
-
0925. 댓글 화면 출력(댓글 작성, 수정-확인 및 취소, 삭제)Spring 2023. 9. 25. 18:55
🌱댓글 화면 출력 댓글이 화면상에 보이게 할 것이다. [구현할 기능] 댓글 목록보기 새 댓글 작성(작성자 아닌 회원만) 댓글 수정(수정 확인 + 수정 취소) 댓글 삭제 * JSON JS Object 를 JSON 문자열로 바꾸는 것 : 직렬화 JSON 문자열을 JS Object 로 바꾸는 것 : 역직렬화 parse( ) - 문자열을 해석해서 처리하는 역할 📍rest.js 작업 댓글 등록 ⭐method, headers, body를 잘 봐야 한다. rest.js 에 추가 //fetch의 메서드 옵션을 post로 지정 async function rest_create(url, data) { try { let res = await fetch(url, { method: "POST", headers: { "Conten..
-
0922. 게시글 버튼 수정(권한에 따라 숨기기)카테고리 없음 2023. 9. 23. 11:07
상세보기에서 로그인을 안 해도 수정이나 삭제 버튼이 보이는 문제를 수정해야 한다. get.jsp => menu.jsp 에서 principal을 username으로 저장해 놓았기 때문에 get.jsp에서 if로 쓸 수 있는 것이다. modify에서 수정기능도 고치기 modify.jsp 글 수정 제목 내용 확인 취소 돌아가기 +) post 전송했는데 한글 안 깨지는 이유 package org.galapagos.config; import javax.sql.DataSource; import org.galapagos.security.CustomUserDetailsService; import org.springframework.beans.factory.annotation.Autowired; import org.sp..
-
0922. 댓글처리 Ajax, REST APISpring 2023. 9. 22. 17:51
🌱서론 자바스크립트는 멀티스레드를 지원하지 않기 때문에 비동기로만 할 수 있다. 지금까지는 데이터를 form 태그를 사용한 1, 2번 방식으로 보냈다. 1. 이름 = 값&이름=값& ... => default 인코딩 : 제일 많이 씀 2. header 띄우고 body ...=> multipart 인코딩 : 바이너리파일 이제 나오는 건 자바스크립트로 표현할 때 쓰는 Ajax 형식이다. { "키" : 값, "키" : 값 ... } => application/json 인코딩 : Ajax 📍Ajax Asynchronous Javascript and XML (비동기 자바스크립트와 XML) 페이지의 이동(깜빡임) 없이 자바스크립트로 서버와 통신하는 기법이다. 최근 데이터 표현 : xml < Json *전송과 응답 시..