[JAVA]getBean Test Main

JAVA 2017. 11. 24. 13:27

getBean Test Main



public static void main(String[] args) throws Exception{

String tableName = "TOUR_DATA";

StringBuffer query = new StringBuffer();

query.append("SELECT TABLE_NAME, COLUMN_NAME, DATA_TYPE, DATA_LENGTH, DATA_PRECISION, DATA_SCALE, NULLABLE  FROM COLS "); 

query.append("\nWHERE TABLE_NAME = '").append(tableName).append("'");

query.append("\nORDER BY TABLE_NAME, COLUMN_ID");

System.out.println(query.toString());


ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("/egovframework/spring/com/context-datasource.xml");

applicationContext.start();


BasicDataSource ds = applicationContext.getBean("dataSource-oracle", BasicDataSource.class); //dataSource-oracle-real_test

JdbcTemplate jdbcTemplate = new JdbcTemplate(ds);

List<Map<String,Object>> columnList = jdbcTemplate.queryForList(query.toString());

System.out.println("\n\n");

CamelCaseTest.convertInsertCC(tableName, columnList);

System.out.println("\n\n");

CamelCaseTest.convertResultMapCC(columnList);

System.out.println("\n\n");

CamelCaseTest.convertUpdateCC(tableName, columnList);

System.out.println("\n\n");

CamelCaseTest.printSelect(tableName, columnList);

System.out.println("\n\n");

CamelCaseTest.printDelete(tableName);

}

'JAVA' 카테고리의 다른 글

[JAVA]html를 이미지로 변환  (2) 2017.11.24
[JAVA]HASHMAP 돌리기(SORT)  (0) 2017.11.24
[JAVA]ftp util  (0) 2017.11.24
[JAVA]filter에서 파라미터 받기  (1) 2017.11.23
[JAVA]Filter를 이용한 request 파라미터 변경 방법  (0) 2017.11.23
블로그 이미지

마크제이콥스

초보 개발자의 이슈및 공부 내용 정리 블로그 입니다.

,