티스토리 뷰
file.my=C:\\file\\
@Value("${file.my}")
private String path;
@Scheduled(cron="${batch.time4}")
public void aBatch() throws Exception{
System.out.println("My Batch Start");
try {
SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMdd");
Calendar cal=Calendar.getInstance();
cal.add(cal.DATE, -1);
String file1="";
String date=sdf.format(cal.getTime());
file1="a_"+date+".txt";
File myFile = new File(path+file1); //config.properties
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(myFile),"EUC-KR"));//문자인코딩
String line = null;
int resultCnt=0;
while ((line = reader.readLine()) != null ) {
System.out.println(line);
if(line != null){
String[] arr = line.split("-");
if(arr.length > 5){
HashMap map = new HashMap();
String empNo=arr[8];
if(empNo == null || "".equals(empNo)){
continue;
}
map.put("EMP_NO" ,empNo);
map.put("WORK_DATE" ,arr[0]);
map.put("WORK_TIME" ,arr[1]);
cDao.insertA(map);
}
}
resultCnt++;
}
} catch (Exception e) {
}
}
- Total
- Today
- Yesterday
- 스크래핑
- 오라클
- EC
- 파싱
- XE
- 문자열
- php
- webix
- 인포믹스
- 자바 smtp
- XE3
- 포인터
- 라이믹스 모듈
- JDBC
- xe addon
- 파이썬
- Python
- KG
- ocajp
- 자바
- 플러터
- proc
- 이클립스
- C
- ocjap
- xe애드온
- MySQL
- C언어
- esql
- 프로씨
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |