본문 바로가기

전체 글

(69)
마우스 이벤트 mouseover,mouseleave test Show Close ·123123. ·456456.    test Show Close ·123123. ·456456. " data-ke-type="html">HTML 삽입미리보기할 수 없는 소스
PostgreSql의 문자열 추출/자르기(unnest/split_part) 예를 들어 어떤 테이블의 컬럼 값이 이와 같이 있다면 테스트 테이블 및 컬럼테이블 : testtable컬럼 : testcolumn컬럼 데이터 : 전송 = ID: [1,2], 코드: KBCD, 명: 테스트, email 주소: test01@test.com select unnest(string_to_array(SUBSTRING(xa. testcolumn FROM '\[(.*?)\]'), ',')) as test_id          , split_part(split_part(xa. testcolumn , '명: ', 2), ',', 1) as test_nm  from testtable xa unnest(string_to_array(SUBSTRING(xa. testcolumn FROM '\[(.*?)\]'), ..
StringBuilder로 반복하여 콤마 표시 String test = null;StringBuilder sb = new StringBuilder();for (testDto dataMap : testDataList) { if (sb.length() > 0) { sb.append(","); } sb.append(dataMap.getTest_id());}test = sb.toString(); String 변수 test를 null로 초기화StringBuilder를 초기화합니다.testDto 객체 리스트인 testDataList를 반복문으로 순회StringBuilder에 이미 내용이 있는지 확인하고, 있다면 콤마를 추가현재 testDto 객체의 test_id를 StringBuilder에 추가반복문이 끝난 후, StringBuil..
HttpResponse<InputStream> 예제 //PDF private HttpResponse callGetApiByPdf(String url) throws Exception { log.info("[API] url = {} " , url ); Unirest.setTimeouts(30 * 1000, 30 * 1000); HttpResponse response = Unirest.get(yml에선언 + url) .header("Accept", "application/octet-stream") .asBinary(); log.info("[API] response.getStatus() = {} " , response.getStatus() ); log.info("[API] response.getBody() = {} " , response.getBody(..
Unirest 사용하여 PDF 파일과 같은 바이너리 데이터를 가져와보자 Unirest 라이브러리를 사용하여 특정 URL로 GET 요청을 보내고, 응답을 InputStream 형식으로 받는 메서드private HttpResponse callGetApiByPdf(String url) throws Exception { log.info("[API] url = {} " , url ); Unirest.setTimeouts(30 * 1000, 30 * 1000); HttpResponse response = Unirest.get(yml에선언 + url) .header("Accept", "application/octet-stream") .asBinary(); log.info("[API] response.getStatus() = {} " , response.getStatus() ); ..
BufferedWriter, BufferedReader 데이터 읽고 쓰기 HttpURLConnection conn = (HttpURLConnection)url.openConnection(); conn.setRequestMethod("POST"); conn.setRequestProperty("Access-Control-Allow-Origin", "*"); conn.setRequestProperty("Content-Type", "application/json"); conn.setRequestProperty("Accept", "application/json"); conn.setDoInput(true); conn.setDoOutput(true); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(conn.getOutputS..