일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
- jQuery
- architecture
- 초단위
- Entity Code 치환
- select
- sftp
- 자바스크립트
- js
- 리눅스
- javascript
- docker 컨테이너로 띄우기
- insert
- Linux
- 만들면서 배우는 클린 아키텍처
- aws elasticache 활용
- 제이쿼리
- Docker Compose
- 자바
- redis + spring boot 함께
- mysql
- feignClient
- 엔티티 코드 치환
- catalina.out
- Tomcat
- Java
- springboot+redis
- 톰캣
- 정규식
- for문
- 특수문자 치환
- Today
- Total
목록Java (24)
꾸준하게, 차근차근

1. Collections.sort() import java.util.ArrayList; import java.util.Collections; public class Test { public static void main(String[] args) { ArrayList list = new ArrayList(); list.add("A"); list.add("B"); list.add("C"); list.add("a"); list.add("b"); list.add("c"); // 오름차순 Collections.sort(list); System.out.println("오름차순 : " + list); // 내림차순 Collections.sort(list, Collections.reverseOrder()); Sys..

1. For문 public class Test { public static void main(String[] args) { int[] arr = {1,2,3,4,5,6,7,8,9}; int sum = 0; for( int i=0; i a+b); System.out.println(sum); } } 3. reduce() public class Test { public static void main(String[] args) { int[] arr = {1,2,3,4,5,6,7,8,9}; int sum = Arrays.stream(arr).reduce(0, (a,b) -> a+b); System.out.println(sum); } } 4. sum() public class Test { public static ..

1. maven dependency 설정 com.fasterxml.jackson.core jackson-core 2.3.0 com.fasterxml.jackson.core jackson-databind 2.3.0 2. JsonString To Map import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; public static void main(String[] args) { String dataStr = (String) jsonObj.get("data"); HashMap dataMap = new ObjectMapper() .readValue(dataStr, new Typ..

1. getOrDefault 찾는 키가 존재한다면 찾는 키의 값을 반환하고 존재하지 않는다면 기본값을 반환하는 메소드 2. 사용 방법 getOrDefault(Object key, V DefaultValue) 매개변수 : 두개의 매개변수를 허용한다. key : 값을 가져와야 하는 요소의 키 defaultValue : 지정된 키로 매핑된 값이 없는 경우 반환되어야 하는 기본값 반환값 : 찾는 key가 존재하면 해당 key에 매핑되어 있는 값을 반환하고 그렇지 않으면 기본값이 반환된다. 3. 사용 예제 /** * 완주하지 못한 선수 */ public class Code { public static void main(String[] args) { String[] participant1 = {"leo", "kik..

1. application/json과 application/x-www-form-urlencoded application/json은 {key: value}의 형태로 전송되지만 application/x-www-form-urlencoded는 key=value&key=value의 형태로 전달된다. 즉 application/x-www-form-urlencoded는 보내는 데이터를 URL인코딩 이라고 부르는 방식으로 인코딩 후에 웹서버로 보내는 방식을 의미한다. public JSONObject httpPost(String url, HashMap param) { JSONObject jsonObj = null; try { // TLS/SSL 통신 무시 TrustManager[] trustAllcerts = new Tr..

1. List 직접 생성 public static void main(String[] args) { Map map = new HashMap(); for( int i=0; i

1. For문 public static void main(String[] args) { List list = Arrays.asList(1,2,3,4,4,5,5,6); int[] arr = new int[list.size()]; for( int i=0; i

1. SFTP 전송시 필요한 정보 User Ip User Port User Id User Password Upload Path 2. sendSFTP 메소드 구현 public void sendSftp(HashMap map) { try { String originFileName = (String) map.get("fileName"); String zipFileName = originFileName.substring(0, originFileName.lastIndexOf(".")) + ".zip"; String sftpIp = configService.getConfigValue("IP"); int sftpPort = Integer.parseInt(configService.getConfigValue("PORT")..