prop = new Properties();
is = RapideUnloader.class.getClassLoader().getResourceAsStream(_propFile);
prop.load(is);
- driver = prop.getProperty(database + "." + "driver");
- user = prop.getProperty(database + "." + "user");
- pass = prop.getProperty(database + "." + "pass");
+ user = prop.getProperty(database + "." + "us");
+ pass = prop.getProperty(database + "." + "pw");
url = prop.getProperty(database + "." + "url");
- CmnUtils.debugPrint("user=" + user);
- CmnUtils.debugPrint("pass=" + pass);
- CmnUtils.debugPrint("url=" + url);
- CmnUtils.debugPrint("driver=" + driver);
+ driver = prop.getProperty(database + "." + "dr");
is.close();
is = null;
} catch (NullPointerException e) {
int tb_count = 0;
int tb_col_count = 0;
- boolean isOrder = CmnUtils.getSystemProperty("order", false);
- boolean isQuotation = CmnUtils.getSystemProperty("quotation", true);
- boolean isInclTables = CmnUtils.getSystemProperty("inclTables", false);
- boolean isExclTables = CmnUtils.getSystemProperty("exclTables", false);
- boolean isMask = CmnUtils.getSystemProperty("inclMaskCols", false) || CmnUtils.getSystemProperty("exclMaskCols", false);
- boolean isInclMaskCols = CmnUtils.getSystemProperty("inclMaskCols", false);
- boolean isExclMaskCols = CmnUtils.getSystemProperty("exclMaskCols", false);
- boolean isInclCols = CmnUtils.getSystemProperty("inclCols", false);
- boolean isExclCols = CmnUtils.getSystemProperty("exclCols", false);
- String sprtr = CmnUtils.getSeparator("sprtr", "\t");
- String lnSprtr = CmnUtils.getLineSeparator("lnSprtr", System.getProperty("line.separator"));
- String inColSprtr = CmnUtils.getLineSeparator("inColSprtr", System.getProperty("line.separator"));
+ boolean isOrder = CmnUtils.getSystemProperty("od", false);
+ boolean isQuotation = CmnUtils.getSystemProperty("qt", true);
+ boolean isInclTables = CmnUtils.getSystemProperty("it", false);
+ boolean isExclTables = CmnUtils.getSystemProperty("et", false);
+ boolean isInclCols = CmnUtils.getSystemProperty("ic", false);
+ boolean isExclCols = CmnUtils.getSystemProperty("ec", false);
+ boolean isMask = CmnUtils.getSystemProperty("imc", false) || CmnUtils.getSystemProperty("emc", false);
+ boolean isInclMaskCols = CmnUtils.getSystemProperty("imc", false);
+ boolean isExclMaskCols = CmnUtils.getSystemProperty("emc", false);
+ String dlmtr = CmnUtils.getSeparator("dm", "\t");
+ String lnSprtr = CmnUtils.getLineSeparator("ls", System.getProperty("line.separator"));
String defaultFldr = "output";
- String outFldr = System.getProperty("output");
- String inclTables = System.getProperty("inclTables");
- String exclTables = System.getProperty("exclTables");
- String inclCols = System.getProperty("inclCols");
- String exclCols = System.getProperty("exclCols");
- String inclMaskCols = System.getProperty("inclMaskCols");
- String exclMaskCols = System.getProperty("exclMaskCols");
- String [] aryInclTables = CmnUtils.getSystemProperty("inclTables");
- String [] aryExclTables = CmnUtils.getSystemProperty("exclTables");
- String [] aryInclMaskCols = CmnUtils.getSystemProperty("inclMaskCols");
- String [] aryExclMaskCols = CmnUtils.getSystemProperty("exclMaskCols");
- String [] aryInclCols = CmnUtils.getSystemProperty("inclCols");
- String [] aryExclCols = CmnUtils.getSystemProperty("exclCols");
- char hankakuMask = CmnUtils.getSystemProperty("hankakuMask", '*');
- char zenkakuMask = CmnUtils.getSystemProperty("zenkakuMask", '\81\96');
- String maskPtn = CmnUtils.getSystemProperty("maskPtn", "alt");
- String fileEncoding = CmnUtils.getSystemProperty("fileEncoding", System.getProperty("file.encoding"));
+ String outFldr = System.getProperty("out");
+ String inclTables = System.getProperty("it");
+ String exclTables = System.getProperty("et");
+ String inclCols = System.getProperty("ic");
+ String exclCols = System.getProperty("ec");
+ String inclMaskCols = System.getProperty("imc");
+ String exclMaskCols = System.getProperty("emc");
+ String [] aryInclTables = CmnUtils.getSystemProperty("it");
+ String [] aryExclTables = CmnUtils.getSystemProperty("et");
+ String [] aryInclMaskCols = CmnUtils.getSystemProperty("imc");
+ String [] aryExclMaskCols = CmnUtils.getSystemProperty("emc");
+ String [] aryInclCols = CmnUtils.getSystemProperty("ic");
+ String [] aryExclCols = CmnUtils.getSystemProperty("ec");
+ char hankakuMask = CmnUtils.getSystemProperty("hmm", '*');
+ char zenkakuMask = CmnUtils.getSystemProperty("zmm", '\81\96');
+ String maskPtn = CmnUtils.getSystemProperty("mp", "alt");
+ String fileEncoding = CmnUtils.getSystemProperty("fe", System.getProperty("file.encoding"));
if(database != null){
- if(System.getProperty("propFile") != null){
- getProperties(System.getProperty("propFile"));
+ if(System.getProperty("pf") != null){
+ getProperties(System.getProperty("pf"));
} else {
getProperties(propFile);
}
} else {
- user = System.getProperty("user");
- pass = System.getProperty("pass");
+ user = System.getProperty("us");
+ pass = System.getProperty("pw");
url = System.getProperty("url");
- driver = System.getProperty("driver");
-
+ driver = System.getProperty("dr");
}
+ CmnUtils.debugPrint("user=" + user);
+ CmnUtils.debugPrint("password=" + pass);
+ CmnUtils.debugPrint("url=" + url);
+ CmnUtils.debugPrint("driver=" + driver);
if(user == null){
throw new Exception("user is null");
} else if (pass == null){
- throw new Exception("pass is null");
+ throw new Exception("password is null");
} else if (url == null){
throw new Exception("url is null");
} else if (driver == null){
if(outFldr != null){
fldr = new File(outFldr);
} else {
- if (database != null){
+ if(database != null){
fldr = new File(defaultFldr + "/" + database.toUpperCase() + "_" + CmnUtils.getYmdhm());
} else {
fldr = new File(defaultFldr + "/" + DB_TYPE_NAME[dbType].toUpperCase() + "_" + CmnUtils.getYmdhm());
fldr.mkdir();
}
- CmnUtils.infoPrint("-->\91Î\8fÛ\83f\81[\83^\83x\81[\83X='" + database.toUpperCase() + "'");
- CmnUtils.infoPrint("-->\8fo\97Í\90æ='" + fldr + "'");
- CmnUtils.infoPrint("-->\8bæ\90Ø\82è\95¶\8e\9a='" + sprtr + "'");
- CmnUtils.infoPrint("-->\83\\81[\83g=" + CmnUtils.getYesNo(isOrder));
- CmnUtils.infoPrint("-->\88ø\97p\8bå=" + CmnUtils.getYesNo(isQuotation));
- if(isInclTables)CmnUtils.infoPrint("-->\91Î\8fÛ\83e\81[\83u\83\8b='" + inclTables.toUpperCase() + "'");
- if(isExclTables)CmnUtils.infoPrint("-->\8f\9c\8aO\83e\81[\83u\83\8b='" + exclTables.toUpperCase() + "'");
- if(isInclCols)CmnUtils.infoPrint("-->\91Î\8fÛ\83J\83\89\83\80='" + inclCols.toUpperCase() + "'");
- if(isExclCols)CmnUtils.infoPrint("-->\8f\9c\8aO\83J\83\89\83\80='" + exclCols.toUpperCase() + "'");
- CmnUtils.infoPrint("-->\83}\83X\83L\83\93\83O=" + CmnUtils.getYesNo(isMask));
+ if(database!=null)CmnUtils.infoPrint("-->Database='" + database.toUpperCase() + "'");
+ CmnUtils.infoPrint("-->Output='" + fldr + "'");
+ if(System.getProperty("dm")!=null)CmnUtils.infoPrint("-->Delimiter='" + dlmtr + "'");
+ if(System.getProperty("ls")!=null)CmnUtils.infoPrint("-->LineSeparator='" + System.getProperty("ls") + "'");
+ if(System.getProperty("fe")!=null)CmnUtils.infoPrint("-->FileEncoding='" + fileEncoding + "'");
+ if(System.getProperty("qt")!=null)CmnUtils.infoPrint("-->Quotation=" + CmnUtils.getYesNo(isQuotation));
+ if(System.getProperty("od")!=null)CmnUtils.infoPrint("-->Sort=" + CmnUtils.getYesNo(isOrder));
+ if(isInclTables)CmnUtils.infoPrint("-->Include Tables='" + inclTables.toUpperCase() + "'");
+ if(isExclTables)CmnUtils.infoPrint("-->Exclude Tables='" + exclTables.toUpperCase() + "'");
+ if(isInclCols)CmnUtils.infoPrint("-->Include Columns='" + inclCols.toUpperCase() + "'");
+ if(isExclCols)CmnUtils.infoPrint("-->Exclude Columns='" + exclCols.toUpperCase() + "'");
if(isMask){
- CmnUtils.infoPrint("-->\83}\83X\83N\83L\83\93\83O\83p\83^\81[\83\93=" + maskPtn.toUpperCase());
- if(isInclMaskCols)CmnUtils.infoPrint("-->\83}\83X\83N\91Î\8fÛ\83J\83\89\83\80='" + inclMaskCols.toUpperCase() + "'");
- if(isExclMaskCols)CmnUtils.infoPrint("-->\83}\83X\83N\8f\9c\8aO\83J\83\89\83\80='" + exclMaskCols.toUpperCase() + "'");
- CmnUtils.infoPrint("-->\94¼\8ap\83}\83X\83N\95¶\8e\9a='" + hankakuMask + "'");
- CmnUtils.infoPrint("-->\91S\8ap\83}\83X\83N\95¶\8e\9a='" + zenkakuMask + "'");
+ CmnUtils.infoPrint("-->Masking=" + CmnUtils.getYesNo(isMask));
+ CmnUtils.infoPrint("-->Masking Pattern=" + maskPtn.toUpperCase());
+ if(isInclMaskCols)CmnUtils.infoPrint("-->Masking Columns='" + inclMaskCols.toUpperCase() + "'");
+ if(isExclMaskCols)CmnUtils.infoPrint("-->NonMasking Columns='" + exclMaskCols.toUpperCase() + "'");
+ CmnUtils.infoPrint("-->1byte Mask Mark='" + hankakuMask + "'");
+ CmnUtils.infoPrint("-->2byte Mask Mark='" + zenkakuMask + "'");
}
- CmnUtils.infoPrint("\83f\81[\83^\83A\83\93\83\8d\81[\83h\82ð\8aJ\8en\82µ\82Ü\82µ\82½\81B");
+ CmnUtils.infoPrint("Start DataUnload ---------------------------------------------");
dao.select(sql_table_list);
alData = dao.getArrayList();
!CmnUtils.isMatch(aryExclMaskCols,alData.get(i).toUpperCase(),alColName.get(j).toUpperCase())
)
){
- CmnUtils.debugPrint("\83}\83X\83N\91Î\8fÛ\83J\83\89\83\80" + alColName.get(j).toUpperCase());
+ CmnUtils.debugPrint("Mask Column=" + alColName.get(j).toUpperCase());
alColMask.add(true);
} else {
alColMask.add(false);
!CmnUtils.isMatch(aryExclCols,alData.get(i).toUpperCase(),alColName.get(j).toUpperCase())
)
){
- CmnUtils.debugPrint("\91Î\8fÛ\83J\83\89\83\80=" + alColName.get(j).toUpperCase());
+ CmnUtils.debugPrint("column=" + alColName.get(j).toUpperCase());
alColIncl.add(true);
} else {
alColIncl.add(false);
} else {
if(colIncl[j]){
if(isQuotation){
- pw.print("\"" + sprtr + "\"");
+ pw.print("\"" + dlmtr + "\"");
} else {
- pw.print(sprtr);
+ pw.print(dlmtr);
}
}
}
}
}
- dao.getRecordToPrint(pw,sprtr,isQuotation,isMask,firstCol,lastCol);
+ dao.getRecordToPrint(pw,dlmtr,isQuotation,isMask,firstCol,lastCol);
dao.closeRecordSet();
pw.close();
pw = null;
pw=null;
}
}
- CmnUtils.infoPrint("\83f\81[\83^\83A\83\93\83\8d\81[\83h\82ð\8fI\97¹\82µ\82Ü\82µ\82½\81B");
+ CmnUtils.infoPrint("End DataUnload -----------------------------------------------");
}