전체 글166 Java에서의 Lamda - 인터페이스함수 자료형에 해당하는 인터페이스// 인터페이스 public interface FuncInterface { public void func(String param); } - 호출receive라는 메소드의 인자로 인터페이스 객체를 받아 그 인터페이스 객체 에서 함수를 호출하여 사용 public void receive(FuncInterface interface) { interface.Func("param"); } - 1. 인터페이스 함수 정의인터페이스 객체를 만들면서 함수를 정의receive( new FuncInterface(){ public void func(String param){ do(param); } } ); - 2. Lamda람다 표현식으로 바꾸면 간단히 표현 가능receive( par.. 2019. 1. 10. [Spring] JSON maven com.google.code.gson gson 2.8.5 String to JSON String sData; JsonParser parser = new JsonParser(); JsonObject jsonObj = (JsonObject) parser.parse(sData); cf. 받은 String 데이터를 Paser로 JsonObject로 만들고 JsonObject내에서 키 값으로 해당 값을 꺼낼때문자열 데이터 일 경우 toString() 시켜 버리면 양쪽에 쌍따옴표(\")문자를 달고 나오므로 getAsString() 메소드를 이용해야 한다. 2019. 1. 10. [Spring] RestTemplate.postForObject() maven commons-httpclient commons-httpclient 3.1 org.apache.httpcomponents httpclient 4.5.6 org.apache.httpcomponents httpasyncclient 4.1.4 java String URL = "http://localhost:8080"; MultiValueMap params = new LinkedMultiValueMap(); // body 파라미터 params.add("key", "value"); // ContentType HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); HttpEntity httpEn.. 2019. 1. 10. Collation 오류 (JDBC + MariaDB) Mybatis 하다가 java.sql.SQLException: Illegal mix of collations (utf8mb4_general_ci,COERCIBLE) and (utf8mb4_unicode_ci,COERCIBLE) for operation '=' 이런 오류남 1. 전체 설정DB의 collation_connection을 맞춰 주거나Table을 맞춰줌 2. 부분 설정SQL 문에서 해당 문제 부분만 COLLATE utf8mb4_unicode_ci 붙여서 설정해 줌 2018. 11. 7. 이전 1 2 3 4 5 ··· 42 다음