リビジョン | 2cac051908c3f5e6e55b8df6841ebdab18b42abe (tree) |
---|---|
日時 | 2017-01-24 07:57:03 |
作者 | kuboryu <kuboryu@yaho...> |
コミッター | kuboryu |
20170124
@@ -295,8 +295,8 @@ public class DataAccessObjects{ | ||
295 | 295 | isQuotation = _isQuotation; |
296 | 296 | isMask = _isMask; |
297 | 297 | recCount = 0; |
298 | - String lnSprtr = CmnUtils.getLineSeparator("lnSprtr", System.getProperty("line.separator")); | |
299 | - if(System.getProperty("nullMark")!= null)nullMark = System.getProperty("nullMark"); | |
298 | + String lnSprtr = CmnUtils.getLineSeparator("ls", System.getProperty("line.separator")); | |
299 | + if(System.getProperty("nm")!= null)nullMark = System.getProperty("nm"); | |
300 | 300 | while (rst.next()) { |
301 | 301 | colString = null; |
302 | 302 | for(int i=0;i<ColumnCount;i++){ |
@@ -393,11 +393,11 @@ public class DataAccessObjects{ | ||
393 | 393 | Clob colClob = null; |
394 | 394 | ByteArrayOutputStream baos = null; |
395 | 395 | InputStream is = null; |
396 | - boolean isQuotation = CmnUtils.getSystemProperty("quotation", true); | |
397 | - boolean isMask = CmnUtils.getSystemProperty("inclMaskCols", false) || CmnUtils.getSystemProperty("exclMaskCols", false); | |
398 | - char hankakuMask = CmnUtils.getSystemProperty("hankakuMask", '*'); | |
399 | - char zenkakuMask = CmnUtils.getSystemProperty("zenkakuMask", '*'); | |
400 | - String maskPtn = CmnUtils.getSystemProperty("maskPtn", MASK_PTN[MASK_PTN_ALT]); | |
396 | + boolean isQuotation = CmnUtils.getSystemProperty("qt", true); | |
397 | + boolean isMask = CmnUtils.getSystemProperty("imc", false) || CmnUtils.getSystemProperty("emc", false); | |
398 | + char hankakuMask = CmnUtils.getSystemProperty("hmm", '*'); | |
399 | + char zenkakuMask = CmnUtils.getSystemProperty("zmm", '*'); | |
400 | + String maskPtn = CmnUtils.getSystemProperty("mp", MASK_PTN[MASK_PTN_ALT]); | |
401 | 401 | |
402 | 402 | if (CmnUtils.isColString(_colTypeName)) { |
403 | 403 | colString = _rst.getString(_rec_cnt); |
@@ -106,14 +106,10 @@ public class RapideUnloader{ | ||
106 | 106 | prop = new Properties(); |
107 | 107 | is = RapideUnloader.class.getClassLoader().getResourceAsStream(_propFile); |
108 | 108 | prop.load(is); |
109 | - driver = prop.getProperty(database + "." + "driver"); | |
110 | - user = prop.getProperty(database + "." + "user"); | |
111 | - pass = prop.getProperty(database + "." + "pass"); | |
109 | + user = prop.getProperty(database + "." + "us"); | |
110 | + pass = prop.getProperty(database + "." + "pw"); | |
112 | 111 | url = prop.getProperty(database + "." + "url"); |
113 | - CmnUtils.debugPrint("user=" + user); | |
114 | - CmnUtils.debugPrint("pass=" + pass); | |
115 | - CmnUtils.debugPrint("url=" + url); | |
116 | - CmnUtils.debugPrint("driver=" + driver); | |
112 | + driver = prop.getProperty(database + "." + "dr"); | |
117 | 113 | is.close(); |
118 | 114 | is = null; |
119 | 115 | } catch (NullPointerException e) { |
@@ -155,55 +151,57 @@ public class RapideUnloader{ | ||
155 | 151 | int tb_count = 0; |
156 | 152 | int tb_col_count = 0; |
157 | 153 | |
158 | - boolean isOrder = CmnUtils.getSystemProperty("order", false); | |
159 | - boolean isQuotation = CmnUtils.getSystemProperty("quotation", true); | |
160 | - boolean isInclTables = CmnUtils.getSystemProperty("inclTables", false); | |
161 | - boolean isExclTables = CmnUtils.getSystemProperty("exclTables", false); | |
162 | - boolean isMask = CmnUtils.getSystemProperty("inclMaskCols", false) || CmnUtils.getSystemProperty("exclMaskCols", false); | |
163 | - boolean isInclMaskCols = CmnUtils.getSystemProperty("inclMaskCols", false); | |
164 | - boolean isExclMaskCols = CmnUtils.getSystemProperty("exclMaskCols", false); | |
165 | - boolean isInclCols = CmnUtils.getSystemProperty("inclCols", false); | |
166 | - boolean isExclCols = CmnUtils.getSystemProperty("exclCols", false); | |
167 | - String sprtr = CmnUtils.getSeparator("sprtr", "\t"); | |
168 | - String lnSprtr = CmnUtils.getLineSeparator("lnSprtr", System.getProperty("line.separator")); | |
169 | - String inColSprtr = CmnUtils.getLineSeparator("inColSprtr", System.getProperty("line.separator")); | |
154 | + boolean isOrder = CmnUtils.getSystemProperty("od", false); | |
155 | + boolean isQuotation = CmnUtils.getSystemProperty("qt", true); | |
156 | + boolean isInclTables = CmnUtils.getSystemProperty("it", false); | |
157 | + boolean isExclTables = CmnUtils.getSystemProperty("et", false); | |
158 | + boolean isInclCols = CmnUtils.getSystemProperty("ic", false); | |
159 | + boolean isExclCols = CmnUtils.getSystemProperty("ec", false); | |
160 | + boolean isMask = CmnUtils.getSystemProperty("imc", false) || CmnUtils.getSystemProperty("emc", false); | |
161 | + boolean isInclMaskCols = CmnUtils.getSystemProperty("imc", false); | |
162 | + boolean isExclMaskCols = CmnUtils.getSystemProperty("emc", false); | |
163 | + String dlmtr = CmnUtils.getSeparator("dm", "\t"); | |
164 | + String lnSprtr = CmnUtils.getLineSeparator("ls", System.getProperty("line.separator")); | |
170 | 165 | String defaultFldr = "output"; |
171 | - String outFldr = System.getProperty("output"); | |
172 | - String inclTables = System.getProperty("inclTables"); | |
173 | - String exclTables = System.getProperty("exclTables"); | |
174 | - String inclCols = System.getProperty("inclCols"); | |
175 | - String exclCols = System.getProperty("exclCols"); | |
176 | - String inclMaskCols = System.getProperty("inclMaskCols"); | |
177 | - String exclMaskCols = System.getProperty("exclMaskCols"); | |
178 | - String [] aryInclTables = CmnUtils.getSystemProperty("inclTables"); | |
179 | - String [] aryExclTables = CmnUtils.getSystemProperty("exclTables"); | |
180 | - String [] aryInclMaskCols = CmnUtils.getSystemProperty("inclMaskCols"); | |
181 | - String [] aryExclMaskCols = CmnUtils.getSystemProperty("exclMaskCols"); | |
182 | - String [] aryInclCols = CmnUtils.getSystemProperty("inclCols"); | |
183 | - String [] aryExclCols = CmnUtils.getSystemProperty("exclCols"); | |
184 | - char hankakuMask = CmnUtils.getSystemProperty("hankakuMask", '*'); | |
185 | - char zenkakuMask = CmnUtils.getSystemProperty("zenkakuMask", '*'); | |
186 | - String maskPtn = CmnUtils.getSystemProperty("maskPtn", "alt"); | |
187 | - String fileEncoding = CmnUtils.getSystemProperty("fileEncoding", System.getProperty("file.encoding")); | |
166 | + String outFldr = System.getProperty("out"); | |
167 | + String inclTables = System.getProperty("it"); | |
168 | + String exclTables = System.getProperty("et"); | |
169 | + String inclCols = System.getProperty("ic"); | |
170 | + String exclCols = System.getProperty("ec"); | |
171 | + String inclMaskCols = System.getProperty("imc"); | |
172 | + String exclMaskCols = System.getProperty("emc"); | |
173 | + String [] aryInclTables = CmnUtils.getSystemProperty("it"); | |
174 | + String [] aryExclTables = CmnUtils.getSystemProperty("et"); | |
175 | + String [] aryInclMaskCols = CmnUtils.getSystemProperty("imc"); | |
176 | + String [] aryExclMaskCols = CmnUtils.getSystemProperty("emc"); | |
177 | + String [] aryInclCols = CmnUtils.getSystemProperty("ic"); | |
178 | + String [] aryExclCols = CmnUtils.getSystemProperty("ec"); | |
179 | + char hankakuMask = CmnUtils.getSystemProperty("hmm", '*'); | |
180 | + char zenkakuMask = CmnUtils.getSystemProperty("zmm", '*'); | |
181 | + String maskPtn = CmnUtils.getSystemProperty("mp", "alt"); | |
182 | + String fileEncoding = CmnUtils.getSystemProperty("fe", System.getProperty("file.encoding")); | |
188 | 183 | |
189 | 184 | if(database != null){ |
190 | - if(System.getProperty("propFile") != null){ | |
191 | - getProperties(System.getProperty("propFile")); | |
185 | + if(System.getProperty("pf") != null){ | |
186 | + getProperties(System.getProperty("pf")); | |
192 | 187 | } else { |
193 | 188 | getProperties(propFile); |
194 | 189 | } |
195 | 190 | } else { |
196 | - user = System.getProperty("user"); | |
197 | - pass = System.getProperty("pass"); | |
191 | + user = System.getProperty("us"); | |
192 | + pass = System.getProperty("pw"); | |
198 | 193 | url = System.getProperty("url"); |
199 | - driver = System.getProperty("driver"); | |
200 | - | |
194 | + driver = System.getProperty("dr"); | |
201 | 195 | } |
196 | + CmnUtils.debugPrint("user=" + user); | |
197 | + CmnUtils.debugPrint("password=" + pass); | |
198 | + CmnUtils.debugPrint("url=" + url); | |
199 | + CmnUtils.debugPrint("driver=" + driver); | |
202 | 200 | |
203 | 201 | if(user == null){ |
204 | 202 | throw new Exception("user is null"); |
205 | 203 | } else if (pass == null){ |
206 | - throw new Exception("pass is null"); | |
204 | + throw new Exception("password is null"); | |
207 | 205 | } else if (url == null){ |
208 | 206 | throw new Exception("url is null"); |
209 | 207 | } else if (driver == null){ |
@@ -234,7 +232,7 @@ public class RapideUnloader{ | ||
234 | 232 | if(outFldr != null){ |
235 | 233 | fldr = new File(outFldr); |
236 | 234 | } else { |
237 | - if (database != null){ | |
235 | + if(database != null){ | |
238 | 236 | fldr = new File(defaultFldr + "/" + database.toUpperCase() + "_" + CmnUtils.getYmdhm()); |
239 | 237 | } else { |
240 | 238 | fldr = new File(defaultFldr + "/" + DB_TYPE_NAME[dbType].toUpperCase() + "_" + CmnUtils.getYmdhm()); |
@@ -242,24 +240,26 @@ public class RapideUnloader{ | ||
242 | 240 | fldr.mkdir(); |
243 | 241 | } |
244 | 242 | |
245 | - CmnUtils.infoPrint("-->対象データベース='" + database.toUpperCase() + "'"); | |
246 | - CmnUtils.infoPrint("-->出力先='" + fldr + "'"); | |
247 | - CmnUtils.infoPrint("-->区切り文字='" + sprtr + "'"); | |
248 | - CmnUtils.infoPrint("-->ソート=" + CmnUtils.getYesNo(isOrder)); | |
249 | - CmnUtils.infoPrint("-->引用句=" + CmnUtils.getYesNo(isQuotation)); | |
250 | - if(isInclTables)CmnUtils.infoPrint("-->対象テーブル='" + inclTables.toUpperCase() + "'"); | |
251 | - if(isExclTables)CmnUtils.infoPrint("-->除外テーブル='" + exclTables.toUpperCase() + "'"); | |
252 | - if(isInclCols)CmnUtils.infoPrint("-->対象カラム='" + inclCols.toUpperCase() + "'"); | |
253 | - if(isExclCols)CmnUtils.infoPrint("-->除外カラム='" + exclCols.toUpperCase() + "'"); | |
254 | - CmnUtils.infoPrint("-->マスキング=" + CmnUtils.getYesNo(isMask)); | |
243 | + if(database!=null)CmnUtils.infoPrint("-->Database='" + database.toUpperCase() + "'"); | |
244 | + CmnUtils.infoPrint("-->Output='" + fldr + "'"); | |
245 | + if(System.getProperty("dm")!=null)CmnUtils.infoPrint("-->Delimiter='" + dlmtr + "'"); | |
246 | + if(System.getProperty("ls")!=null)CmnUtils.infoPrint("-->LineSeparator='" + System.getProperty("ls") + "'"); | |
247 | + if(System.getProperty("fe")!=null)CmnUtils.infoPrint("-->FileEncoding='" + fileEncoding + "'"); | |
248 | + if(System.getProperty("qt")!=null)CmnUtils.infoPrint("-->Quotation=" + CmnUtils.getYesNo(isQuotation)); | |
249 | + if(System.getProperty("od")!=null)CmnUtils.infoPrint("-->Sort=" + CmnUtils.getYesNo(isOrder)); | |
250 | + if(isInclTables)CmnUtils.infoPrint("-->Include Tables='" + inclTables.toUpperCase() + "'"); | |
251 | + if(isExclTables)CmnUtils.infoPrint("-->Exclude Tables='" + exclTables.toUpperCase() + "'"); | |
252 | + if(isInclCols)CmnUtils.infoPrint("-->Include Columns='" + inclCols.toUpperCase() + "'"); | |
253 | + if(isExclCols)CmnUtils.infoPrint("-->Exclude Columns='" + exclCols.toUpperCase() + "'"); | |
255 | 254 | if(isMask){ |
256 | - CmnUtils.infoPrint("-->マスクキングパターン=" + maskPtn.toUpperCase()); | |
257 | - if(isInclMaskCols)CmnUtils.infoPrint("-->マスク対象カラム='" + inclMaskCols.toUpperCase() + "'"); | |
258 | - if(isExclMaskCols)CmnUtils.infoPrint("-->マスク除外カラム='" + exclMaskCols.toUpperCase() + "'"); | |
259 | - CmnUtils.infoPrint("-->半角マスク文字='" + hankakuMask + "'"); | |
260 | - CmnUtils.infoPrint("-->全角マスク文字='" + zenkakuMask + "'"); | |
255 | + CmnUtils.infoPrint("-->Masking=" + CmnUtils.getYesNo(isMask)); | |
256 | + CmnUtils.infoPrint("-->Masking Pattern=" + maskPtn.toUpperCase()); | |
257 | + if(isInclMaskCols)CmnUtils.infoPrint("-->Masking Columns='" + inclMaskCols.toUpperCase() + "'"); | |
258 | + if(isExclMaskCols)CmnUtils.infoPrint("-->NonMasking Columns='" + exclMaskCols.toUpperCase() + "'"); | |
259 | + CmnUtils.infoPrint("-->1byte Mask Mark='" + hankakuMask + "'"); | |
260 | + CmnUtils.infoPrint("-->2byte Mask Mark='" + zenkakuMask + "'"); | |
261 | 261 | } |
262 | - CmnUtils.infoPrint("データアンロードを開始しました。"); | |
262 | + CmnUtils.infoPrint("Start DataUnload ---------------------------------------------"); | |
263 | 263 | |
264 | 264 | dao.select(sql_table_list); |
265 | 265 | alData = dao.getArrayList(); |
@@ -330,7 +330,7 @@ public class RapideUnloader{ | ||
330 | 330 | !CmnUtils.isMatch(aryExclMaskCols,alData.get(i).toUpperCase(),alColName.get(j).toUpperCase()) |
331 | 331 | ) |
332 | 332 | ){ |
333 | - CmnUtils.debugPrint("マスク対象カラム" + alColName.get(j).toUpperCase()); | |
333 | + CmnUtils.debugPrint("Mask Column=" + alColName.get(j).toUpperCase()); | |
334 | 334 | alColMask.add(true); |
335 | 335 | } else { |
336 | 336 | alColMask.add(false); |
@@ -357,7 +357,7 @@ public class RapideUnloader{ | ||
357 | 357 | !CmnUtils.isMatch(aryExclCols,alData.get(i).toUpperCase(),alColName.get(j).toUpperCase()) |
358 | 358 | ) |
359 | 359 | ){ |
360 | - CmnUtils.debugPrint("対象カラム=" + alColName.get(j).toUpperCase()); | |
360 | + CmnUtils.debugPrint("column=" + alColName.get(j).toUpperCase()); | |
361 | 361 | alColIncl.add(true); |
362 | 362 | } else { |
363 | 363 | alColIncl.add(false); |
@@ -416,15 +416,15 @@ public class RapideUnloader{ | ||
416 | 416 | } else { |
417 | 417 | if(colIncl[j]){ |
418 | 418 | if(isQuotation){ |
419 | - pw.print("\"" + sprtr + "\""); | |
419 | + pw.print("\"" + dlmtr + "\""); | |
420 | 420 | } else { |
421 | - pw.print(sprtr); | |
421 | + pw.print(dlmtr); | |
422 | 422 | } |
423 | 423 | } |
424 | 424 | } |
425 | 425 | } |
426 | 426 | } |
427 | - dao.getRecordToPrint(pw,sprtr,isQuotation,isMask,firstCol,lastCol); | |
427 | + dao.getRecordToPrint(pw,dlmtr,isQuotation,isMask,firstCol,lastCol); | |
428 | 428 | dao.closeRecordSet(); |
429 | 429 | pw.close(); |
430 | 430 | pw = null; |
@@ -459,7 +459,7 @@ public class RapideUnloader{ | ||
459 | 459 | pw=null; |
460 | 460 | } |
461 | 461 | } |
462 | - CmnUtils.infoPrint("データアンロードを終了しました。"); | |
462 | + CmnUtils.infoPrint("End DataUnload -----------------------------------------------"); | |
463 | 463 | } |
464 | 464 | |
465 | 465 |