본문 바로가기
반응형

Web Programing!301

[POSTGRESQL] order by 정렬순서 내마음대로 바꾸기 (CASE WHEN 사용) [POSTGRESQL] order by 정렬순서 내마음대로 바꾸기 (CASE WHEN 사용) ​​1. 일반적으로 order by 를 했을시 ​select * from 테이블명 order by 필드명 asc;​2. CASE WHEN 사용하여 내가 원하는 정렬순서로 변경시 ​select * from 테이블명 order by case when 필드명 ='ko' then 0 when 필드명 ='en' then 1 end;​​3. CASE WHEN 사용하여 내가 원하는 정렬순서로 변경하고 나머지는 원래 정렬순서대로 정렬​select * from 테이블명 order by case when 필드명 ='ko' then 0 when 필드명 ='en' then 1 end , 필드명 asc;​ 2019. 9. 24.
[spring boot] context-path, 포트 설정 [spring boot] context-path, 포트 설정 프로젝트를 만들고 실행하게 되면 기본 설정인 http://localhost:8080/ 으로 접속하면 초기 화면이 나온다. context-path 추가 src/main/resources/application.properties server.servlet.context-path=/www 설정시 http://localhost:8080/www로 접속가능. server.port=80 설정시 http://localhost/www로 접속가능. 그 외 spring boot 에서 제공하는 많은 option들은 아래 링크에서 확인하면 된다. https://docs.spring.io/spring-boot/docs/current/reference/html/commo.. 2019. 9. 20.
[JAVA] Header 정보 가져오기 [JAVA] Header 정보 가져오기 ​​import java.util.Enumeration​Enumeration headerEnum = request.getHeaderNames();while(headerEnum.hasMoreElements()){ String headerName = (String)headerEnum.nextElement(); String headerValue = request.getHeader(headerName);}​ 2019. 9. 19.
[JAVA] 시작과 끝 시간 측정 long start, end;​start = System.currentTimeMillis(); end = System.currentTimeMillis();​count = (int)(end - start) / 1000;​System.out.println("시간 : " + count + "초");​​ 2019. 9. 18.
반응형