프로그래밍
-
[Springboot] 눙물나는 oracle 설치여행기 (+m1, oracle cloud)프로그래밍/Spring & Springboot 2021. 9. 4. 00:12
회사에서 금요일 퇴근날 급하게 개발방향이 수정됨... 당장 월요일까지는 완료해야 되는 상황인데 주말출근.. 죽어도 하기 싫었다. 그래서 여유롭게^^ 집가서 개발환경 세팅하고 해야지! 하고 칼퇴했다.. springboot + ORACLE로 반드시 개발해야되는 상황이었다. 찾아보니 맥북은 docker로 oracle이 가볍게 열린다길래 마음놓고 집에 왔는데... m1칩은 docker로도 oracle로 접속할 수가 없었다 그래서 부랴부랴 mysql로 야매로 만들고 회사가서 수정하면 되겠지! 라고 생각했으나 은근히 바꿔줘야되는 것들도 많고.. (일단 너무너무 하기 귀찮았다!) 그러다 페러렐즈가 (https://www.parallels.com/kr/pd/general/?gclid=CjwKCAjwj8eJBhA5Eiw..
-
[JPA] 필드와 컬럼 매핑프로그래밍/Java 2021. 8. 20. 11:15
데이터베이스 스키마 자동 생성하기 DDL을 애플리케이션 실행 시점에 자동 생성 테이블 중심 -> 객체 중심 데이터베이스 방언을 활용해서 데이터베이스에 맞는 적절한 DDL 생성 이렇게 생성된 DDL은 개발 장비에서만 사용 생성된 DDL은 운영서버에서는 사용하지 않거나 적절히 다듬은 후 사용 명령문 설명 create 기존 테이블 삭제 후 다시 생성 (DROP + CREATE) create-drop create와 같으나 종료 시점에 테이블 DROP update 변경분만 반영 (운영 DB에서 사용 X) Qvalidate 엔티티와 테이블이 정상 매핑되었는지만 확인 none 사용하지 않음 운영 장비에는 절대 create , create-drop, update 사용 금지 개발 초기 단계는 create 또는 updat..
-
[JPA] 기초와 매핑프로그래밍/Java 2021. 8. 20. 10:40
기초 개념 @Entitiy: JPA가 관리할 객체 @Id: DB PK와 매핑할 필드 @Entity public class Member{ @Id private Long id; private String name; } create table MEMBER 데이터베이스 방언 jpa는 특정 데이터베이스에 종속적이지 않은 기술 각각의 데이터베이스가 제공하는 sql 문법과 함수는 조금씩 다르다. ex. VARCHAR VARCHAR2, SUBSTRINGSUBSTR 방언: sql 표준을 지키지 않거나 특정 데이터베이스만의 고유한 기능 JPA -> DIALECT(인터페이스와 같은 역할)-> MySQLDialect / OracleDialect / H2Dialect 애플리케이션 개발 - 엔티티 매니저 팩토리는 서버를 켤 때 ..
-
[Kafka] 카프카 개념 및 예시코드프로그래밍/기타 2021. 8. 19. 16:20
아파치 Kafka 따라잡기, 니샨트 가르그 카프카의 기본 개념 및 자바를 기반으로 한 예시코드에 대해 알아보겠습니다~! 위에 인용한 책과 구글링을 바탕으로 정리하였습니다. 개념 카프카 소개 메세지 퍼블리싱? 다양한 애플리케이션의 메시지를 서로 전달할 수 있도록 연결하는 구조를 의미한다. 카프카는 대표적인 메시지 브로커이다. 카프카는 실시간으로 대량의 정보를 다루고 여러 정보 소비자에게 빠르게 전달하는 과정에서 생기는 문제점을 해결한 솔루션이다. 카프카를 통해 정보 소비자는 정보 생성자에 대해 알 필요 없고 생산자는 누가 최종소비자인지 알 필요 없이 서로 연동시켜준다. 카프카 특징 - 비휘발성 메시징: 정보 유실 X - 높은 처리량: 초당 수백만 건의 메시지 처리 - 분산: 카프카 서버들을 대상으로 메시지..
-
[node.js] NodeJS + React 연동해서 쿠키🍪 교환하기 (크롬)프로그래밍/Node.js 2021. 6. 29. 20:11
현재 프론트는 React, 백은 Node.js를 이용해서 개발하고 있다. 각각 다른 포트를 사용하여 운영 중인데, 로그인 기능을 위해 두 서버간 쿠키를 전송해야 하는 일이 생겼다. 하지만 크로스도메인 문제 때문인지 서버에서 보낸 쿠키가 브라우저에서 나타나지 않았다. 1) CORS 등록 그래서 검색을 해보니 Node에서는 가장 main app(여기서는 server.js)에 cors를 사용해줘야 한다고 한다! // ... const cors = require('cors'); // ... app.use(cors({ origin: true, credentials: true, // 크로스 도메인 허용 methods: ['POST', 'PUT', 'GET', 'OPTIONS', 'HEAD'], })); 리액트 파일..
-
[JS] 자바스크립트 기본 - 변수와 상수프로그래밍/JavaScript 2021. 4. 28. 16:44
변수 // 변수 선언 let message; // 변수 할당 message = 'Hello'; // 합치기 let message = 'Hello'; // 여러개도 가능 let user = 'John', age = 25, message = 'Hello'; let 대신 var을 사용할 수도 있지만 var은 오래된 방식이다. 변수는 딱 한번만 선언해야 한다. 똑같은 변수명으로 두번 선언할 수 없다. 변수명은 오직 문자와 숫자, 그리고 기호 $와 _만 들어갈 수 있다. 또한 첫 글자는 숫자일 수 없다. 여러 단어를 조합하여 변수명을 만들 때에는 카멜 표기법이 사용된다. // 여러 단어를 조합할 때 첫 단어를 제외한 나머지의 첫글자를 대문자로 작성하는 방법 let userName; 자바스크립트는 대소문자를 구별한..