!101 [SPRING BOOT] 스프링부트로 개발하기 3 - WEB 프로젝트가 아닌 데몬으로 만들기 [SPRING BOOT] 스프링부트로 개발하기 3 - WEB 프로젝트가 아닌 데몬으로 만들기 SpringBootApplication 어노테이션이 설정되어있는 부트 메인클래스에서 CommandLineRunner를 구현하면 사용할 수 있다. package sunghs.boot; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class BootExApplication { public static void main(String[] args) { SpringApplication.run(BootE.. 2019. 7. 16. [SPRING BOOT] 스프링부트로 개발하기 2 - DBCP 설정 [SPRING BOOT] 스프링부트로 개발하기 2 - DBCP 설정 pom.xml Dependency 세팅 spring-boot-jdbc를 기본으로 제공한다. mysql mysql-connector-java runtime org.springframework.boot spring-boot-starter-jdbc application.properties 세팅 spring.datasource에 대한 property key를 기본적으로 제공한다. spring.datasource.platform=mysql spring.datasource.url=jdbc:mysql://localhost:3306/ps spring.datasource.username=root spring.datasource.password=TEST .. 2019. 7. 16. 티스토리 syntaxhighlighter 스킨 적용/변경 하기 #위치 블로그 관리 > 스킨편집 > html 편집 #파일 업로드 ./scripts 아래 *.js 전체 업로드 ./styles 아래 *.css 전체 업로드 - 뭘 사용할지 정했다면 특정 css만 업로드 해도 된다. - 공통 : shCore.css - 선택 : shCore에디터.css + shTheme에디터.css 예) shCore.css + shCoreEclipse.css + shThemeEclipse.css #블로그 CSS 에디터 편집 head 태그 안에 삽입 #적용(업로드)한 sh테마 아래 삽입 예) shThemeEclipse.css를 골랐다면 #그 아래 javascript 붙여넣기 #바디 메소드 추가 (Onload) Onload="dp.SyntaxHighlighter.HighlightAll('code.. 2019. 7. 16. [SPRING BOOT] 스프링부트로 개발하기 1 - 환경설정 요즘 대부분의 자바 기반 개발 프레임워크가 SPRING BOOT 라고 한다. SPRING BATCH, SPRING MVC 같은 모듈 별 START PROJECT는 사용해 봤어도 스프링 모듈을 한번에 쓰기 쉽게 잡아준다는 SPRING BOOT는 한번도 안써봤는데 이번에 써 볼 예정이다. 앞으로 스프링부트로 하는 개발 및 테스트 환경 #IDE Eclipse STS 4 https://spring.io/tools Spring Tools 4 Spring Tools 4 is the next generation of Spring tooling for your favorite coding environment. Largely rebuilt from scratch, it provides world-class suppor.. 2019. 7. 15. [Apache2.4] 특정 IP access 관리 (Apache Allow IP) [Apache2.4]특정 IP access 관리 (Apache Allow IP) Apache 2.4 아래 버전과 2.4 부터 설정 방법에 차이가 있다. 여기서는 2.4 버전 설정을 한다. 예를들어 htdocs를 DocumentRoot로 잡고 DocumentRoot "D:/htdocs" htdocs 하위폴더에 아래와 같이 존재할때 htdocs/subdir1 htdocs/subdir2 htdocs/subdir3 모든IP에 대해 허용 Options Indexes FollowSymLinks AllowOverride None Require all granted 상위 디렉토리에 대해 접근설정을 해놓으면 하위디렉토리가 따로 override 하지 않는 한 동일함. 즉 위와 같이 설정하면 subdir1, subdir2,.. 2019. 5. 28. [JAVA] HTTPS 에서 HTTP 프로토콜 변경 시 세션 유지시키기 HTTPS 에서 HTTP로 프로토콜 변경 시 세션 유지 먼저 HTTPS로 들어온 세션을 쿠키로 만들어 줄 Wrapper Class가 필요하다. import java.util.Collections; import java.util.Enumeration; import java.util.HashMap; import java.util.Map; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.Http.. 2019. 5. 21. [JAVA] HttpServletRequest Parameter 추가 HttpServletRequest Parameter 추가 HttpServletRequest 클래스에는 getParameter만 있고 setParameter는 없다. 클라이언트 단에서 날아온 값으로 서블릿에서는 setAttribute 함수밖에 없으며 setAttribute 값은 getAttribute로 밖에 꺼내올 수 없는데, setAttribute와 setParameter에는 서버에서 세팅했는지, 클라이언트에서 세팅했는지에 대한 차이가 있다. 따라서 다른 API / 라이브러리 등에서 getParamter를 하기전에 이미 들어있는 값을 바꾸려면 httpServletRequest를 전부 복사해서 다시 만들어야 한다. HttpServletRequest를 전부 복사해서 갈아끼우는 Class import java.. 2019. 4. 30. [MSSQL] ISOLATION (LOCK) LEVEL 아래 쿼리 실행하면 레벨에 따라 문자열로 출력 SELECT CASE transaction_isolation_level WHEN 0 THEN 'Unspecified' WHEN 1 THEN 'ReadUncommitted' WHEN 2 THEN 'ReadCommitted' WHEN 3 THEN 'Repeatable' WHEN 4 THEN 'Serializable' WHEN 5 THEN 'Snapshot' END AS TRANSACTION_ISOLATION_LEVEL FROM sys.dm_exec_sessions; 현재쿼리에만 ISOLATION LEVEL을 적용하는 방법이FROM TABLE WITH (ISOLATION_LEVEL) 과 같이 명시하면 됨. 1. READ COMMITED커밋 된 데이터만 SELECT.. 2019. 3. 13. [JAVA] 두 날짜 사이 월 구하기 두 날짜 사이 월 구하기 public static List getMonthList(String startDate, String endDate) { List result = new ArrayList(); int sy = Integer.parseInt(startDate.substring(0, 4)); int sm = Integer.parseInt(startDate.substring(4, 6)); int ey = Integer.parseInt(endDate.substring(0, 4)); int em = Integer.parseInt(endDate.substring(4, 6)); int period = (ey - sy) * 12 + (em - sm); if(period == 0) result.add(start.. 2019. 2. 19. 이전 1 ··· 8 9 10 11 12 다음