|
|
|
|
@ -71,71 +71,7 @@ public class MakeExemptInfo {
|
|
|
|
|
return DriverManager.getConnection(g_strDB[1], g_strDB[2], g_strDB[3]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings({ "resource", "unused" })
|
|
|
|
|
private double runMakeExemptBin() throws Exception {
|
|
|
|
|
long start = System.currentTimeMillis(); // 작동 시간 측정용
|
|
|
|
|
|
|
|
|
|
String sql = "";
|
|
|
|
|
|
|
|
|
|
Connection conn = null; // 통상 Connection으로 선언
|
|
|
|
|
PreparedStatement ps = null; // 통상 PreparedStatement로 선언
|
|
|
|
|
ResultSet rs = null;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
conn = getOrclConn(); // Connection 생성 시 Connection으로 형변환
|
|
|
|
|
|
|
|
|
|
// prepareStatement를 PreparedStatement으로 형변환
|
|
|
|
|
sql= "select * from (";
|
|
|
|
|
sql= sql + " select car_no";
|
|
|
|
|
sql= sql + " , decode(EXEMPT_KBN, '0', '01', '2', '02', '3', '03', '4', '04', '5', '05', '6', '06') as exempt_cd";
|
|
|
|
|
sql= sql + " , car_no_hex";
|
|
|
|
|
sql= sql + " , document_no";
|
|
|
|
|
sql= sql + " , enforce_date";
|
|
|
|
|
sql= sql + " , end_date ";
|
|
|
|
|
sql= sql + " from exempt_cars_info";
|
|
|
|
|
sql= sql + " where to_char(enforce_date,'yyyymmdd') <= to_char(sysdate, 'yyyymmdd')";
|
|
|
|
|
sql= sql + " and to_char(end_date, 'yyyymmdd') >= to_char(sysdate, 'yyyymmdd')";
|
|
|
|
|
sql= sql + " and car_no_hex != '0000000000'";
|
|
|
|
|
sql= sql + " order by car_no_hex";
|
|
|
|
|
|
|
|
|
|
ps = conn.prepareStatement(sql);
|
|
|
|
|
rs = ps.executeQuery( sql );
|
|
|
|
|
rs.setFetchSize(10000);
|
|
|
|
|
|
|
|
|
|
Statement stmt = conn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY,java.sql.ResultSet.CONCUR_READ_ONLY);
|
|
|
|
|
stmt.setFetchSize(10000);
|
|
|
|
|
rs = stmt.executeQuery( sql );
|
|
|
|
|
|
|
|
|
|
String str = "";
|
|
|
|
|
int n = 0;
|
|
|
|
|
File file = new File("./ExemptPL.bin");
|
|
|
|
|
FileOutputStream fos = new FileOutputStream(file);
|
|
|
|
|
while (rs.next()) {
|
|
|
|
|
n++;
|
|
|
|
|
if(n % 100 == 0) {
|
|
|
|
|
System.out.println("===== : " + n);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
str = String.format("%010d%s%02d%s", n, "00", Integer.parseInt(rs.getString(2)), rs.getString(3));
|
|
|
|
|
fos.write(str.getBytes());
|
|
|
|
|
} // end while
|
|
|
|
|
|
|
|
|
|
fos.close();
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}finally{
|
|
|
|
|
if(rs != null)
|
|
|
|
|
rs.close();
|
|
|
|
|
if(ps != null)
|
|
|
|
|
ps.close();
|
|
|
|
|
|
|
|
|
|
conn.close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
System.out.println("===== insert ok");
|
|
|
|
|
long end = System.currentTimeMillis(); // 작동시간 측정용
|
|
|
|
|
return (end - start) / 1000.0; // insertBatchFileToDB 실행에 걸린 시간
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private double runMakeExemptMstBin(long nStart, long nEnd) throws Exception {
|
|
|
|
|
long start = System.currentTimeMillis(); // 작동 시간 측정용
|
|
|
|
|
|