Whiteship
  • Home
  • 인프런 강의
  • Java
  • Spring
  • JPA
  • SDE Tips
Subscribe

데이터 축출

A collection of 1 post
DbUnit

[DBUnit] 테이블 데이터를 엑셀로 export

테스트 @Test public void exportXls() throws Exception { dbUnitSupport.exportXlsFrom(“code”, “item”, “users”, “role”, “users_role”); assertTrue(new File(DBUnitSupport.EXPORTED_XLS_FILE).exists()); }구현 protected void exportXlsFrom(String… tableNames) throws Exception { IDataSet dataSet = getConnection().createDataSet(tableNames); XlsDataSet.write(dataSet, new FileOutputStream(new File(EXPORTED_XLS_FILE))); }흠.. 간단하네요. 간단 간단.
Oct 16, 2009 — 1 min read
Whiteship © 2022
Powered by Ghost