xls 파일 데이터를 sq-lite 데이터베이스에 표시하고 싶습니다. 저에게 도움이 될만한 아이디어가 없습니다. xls 파일을 작성하고 읽었지만 읽지는 않습니다. 't 이제 데이터 내가 할 수 있습니다 사용 BLOB 유형 중 하나와 DB에 바이너리 파일을 저장하려면 읽기 XLS 파일 코드xls 파일 데이터를 sqlite 데이터베이스에 저장하는 방법
try
{
InputStream input = new BufferedInputStream(new FileInputStream("/sdcard/raav.xls"));
POIFSFileSystem fs = new POIFSFileSystem(input);
HSSFWorkbook wb = new HSSFWorkbook(fs);
HSSFSheet sheet = wb.getSheetAt(0);
Iterator rows = sheet.rowIterator();
while(rows.hasNext())
{ HSSFRow row = (HSSFRow)
rows.next();
System.out.println("\n");
Iterator cells = row.cellIterator();
while(cells.hasNext())
{
HSSFCell cell = (HSSFCell) cells.next();
if(HSSFCell.CELL_TYPE_NUMERIC==cell.getCellType())
System.out.print(cell.getNumericCellValue()+" ");
else if(HSSFCell.CELL_TYPE_STRING==cell.getCellType())
System.out.print(cell.getStringCellValue()+" ");
else if(HSSFCell.CELL_TYPE_BOOLEAN==cell.getCellType())
System.out.print(cell.getBooleanCellValue()+" ");
else if(HSSFCell.CELL_TYPE_BLANK==cell.getCellType())
System.out.print("BLANK ");
else
System.out.print("Unknown cell type"); } }}
catch (Exception e) {
}
}
원하는 것을 분명히하지 마십시오. 직접 XLS 파일을 저장하거나 테이블/s로 변환 하시겠습니까? – m0skit0
sq-lite 데이터베이스에 직접 저장하고 싶습니다 – Ravi