메뉴 건너뛰기

Cloudera, BigData, Semantic IoT, Hadoop, NoSQL

Cloudera CDH/CDP 및 Hadoop EcoSystem, Semantic IoT등의 개발/운영 기술을 정리합니다. gooper@gooper.com로 문의 주세요.


1. className = "com.gooper.test.Test"

2. 호출할 메서드 이름 : runMongoQueryByClass

3. 아래는 클래스 com.gooper.test.Test에서 static 메서드인 runMongoQueryByClass를 호출하여 List<Map<String, String>>형태의 결과를 받는 예제이다.

@SuppressWarnings("unchecked")
	private final List<Map<String, String>> getResult (String className, String[] idxVals) throws Exception {
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			Class<?> workClass = Class.forName(className);
			Object newObj = workClass.newInstance();
			Method m = workClass.getDeclaredMethod("runMongoQueryByClass");
			list = (List<Map<String, String>>) m.invoke(newObj);
		
			log.debug("workClass==>"+workClass.getName());
		} catch (Exception e) {
			log.debug(e.getMessage());
		}		
		return list;
	}


번호 제목 날짜 조회 수
33 [gson]mongodb의 api를 이용하여 데이타를 가져올때 "com.google.gson.stream.MalformedJsonException: Unterminated object at line..." 오류발생시 조치사항 2017.12.11 4803
32 lagom-windows용 build.sbt파일 내용 2017.10.12 173
31 lagom-linux용 build.sbt파일 내용 2017.10.12 1415
30 lagom의 online-auction-java프로젝트 실행시 "Could not find Cassandra contact points, due to: ServiceLocator is not bound" 경고 발생시 조치사항 2017.10.12 279
29 python3.5에서 numpy버젼에 따른 문제점을 조치하는 방법및 pymysql import할때 오류 발생시 조치사항 2017.09.28 401
28 python test.py실행시 "ImportError: No module named pyspark" 혹은 "ImportError: No module named py4j.protocol"등의 오류 발생시 조치사항 2017.07.04 866
27 [Jsoup]특정페이지를 jsoup을 이용하여 파싱하는 샘플소스 2017.04.18 409
26 [jsoup]Jsoup Tutorial 2017.04.11 255
25 [메모리 덤프파일 분석] 2017.03.31 259
24 [springframework]Caused by: org.mariadb.jdbc.internal.util.dao.QueryException: Could not read resultset: unexpected end of stream, read 0 bytes from 4 오류 발생시 조치사항 2017.01.23 834
23 [tomcat] logrotate를 이용하여 catalina.out로그파일 일별로 로테이션 저장하기 file 2017.01.18 479
22 List<Map<String, String>>형태의 데이타에서 중복제거 하는 방법 2016.12.23 2041
» Class.forName을 이용한 메서드 호출 샘플소스 2016.12.21 459
20 Collections.sort를 이용한 List<Map<String, String>>형태의 데이타 정렬 소스 2016.12.15 357
19 Collections.sort를 이용한 List<User>형태의 데이타 정렬(숫자, 문자에 대해서 각각 asc/desc및 복합정렬) 2016.12.15 381
18 Eclipse실행시 Java was started but returned exit code=1이라는 오류가 발생할때 조치방법 2016.11.07 575
17 java스레드 덤프 분석하기 file 2016.11.03 184
16 mybatis와 spring을 org.apache.commons.dbcp2.BasicDataSource의 DataSource로 연동할때 DB설정(참고) 2016.10.31 1073
15 Caused by: java.sql.SQLNonTransientConnectionException: Could not read resultset: unexpected end of stream, read 0 bytes from 4 오류시 확인/조치할 내용 2016.10.31 4061
14 VisualVM 1.3.9을 이용한 JVM 모니터링 file 2016.10.27 480
위로