• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Révision5542ffa991cb80f534f88b3ad7d1a336f2ac45dc (tree)
l'heure2017-01-26 08:28:35
Auteurkuboryu <kuboryu@yaho...>
Commiterkuboryu

Message de Log

20170126

Change Summary

Modification

--- a/com/rapide_act/DataAccessObjects.java
+++ b/com/rapide_act/DataAccessObjects.java
@@ -73,6 +73,7 @@ public class DataAccessObjects{
7373 private String tbName = null;
7474 private String nullMark = "";
7575 private String lnSprtr = System.getProperty("line.separator");
76+ private String delimiter = "\t";
7677 private char singleByteChr = '*';
7778 private char doubleByteChr = '*';
7879 private String maskPtn = "ALT";
@@ -299,6 +300,16 @@ public class DataAccessObjects{
299300
300301 public void setPropVal(String[] _prop_val) throws Exception{
301302 prop_val = _prop_val;
303+ if(!CmnUtils.isEmpty(prop_val[LINESEP]))lnSprtr = CmnUtils.getLineSeparator(prop_val[LINESEP]);
304+ if(!CmnUtils.isEmpty(prop_val[NULLMARK]))nullMark = prop_val[NULLMARK];
305+ if(!CmnUtils.isEmpty(prop_val[QUOTATION]) && prop_val[QUOTATION].toUpperCase().equals("N"))isQuotation = false;
306+ if(!CmnUtils.isEmpty(prop_val[INCLCOLMASK]))isInclMaskCols = true;
307+ if(!CmnUtils.isEmpty(prop_val[EXCLCOLMASK]))isExclMaskCols = true;
308+ if(isInclMaskCols || isExclMaskCols)isMask = true;
309+ if(!CmnUtils.isEmpty(prop_val[SBYTEMASKCHR]))singleByteChr = prop_val[SBYTEMASKCHR].charAt(0);
310+ if(!CmnUtils.isEmpty(prop_val[DBYTEMASKCHR]))doubleByteChr = prop_val[DBYTEMASKCHR].charAt(0);
311+ if(!CmnUtils.isEmpty(prop_val[MASKPTN]))maskPtn = prop_val[MASKPTN];
312+ if(!CmnUtils.isEmpty(prop_val[DELIMITER]))delimiter = CmnUtils.getDelimiter(prop_val[DELIMITER]);
302313 }
303314
304315 public ResultSet getResultSet() throws Exception{
@@ -329,14 +340,10 @@ public class DataAccessObjects{
329340 }
330341 }
331342
332- public void getRecordToPrint(PrintWriter _pw, String _splt, boolean _isQuotation, boolean _isMask, int _firstCol, int _lastCol) throws Exception{
343+ public void getRecordToPrint(PrintWriter _pw, int _firstCol, int _lastCol) throws Exception{
333344 try {
334345 CmnUtils.debugPrint("Start get Record to Print");
335- isQuotation = _isQuotation;
336- isMask = _isMask;
337346 recCount = 0;
338- if(!CmnUtils.isEmpty(prop_val[LINESEP]))lnSprtr = CmnUtils.getLineSeparator(prop_val[LINESEP]);
339- if(!CmnUtils.isEmpty(prop_val[NULLMARK]))nullMark = prop_val[NULLMARK];
340347
341348 while (rst.next()) {
342349 colString = null;
@@ -362,15 +369,15 @@ public class DataAccessObjects{
362369
363370 } else if (i == _lastCol){
364371 if(isQuotation){
365- _pw.print("\"" + _splt + "\"" + colString + "\"" + lnSprtr);
372+ _pw.print("\"" + delimiter + "\"" + colString + "\"" + lnSprtr);
366373 } else {
367- _pw.print(_splt + colString + lnSprtr);
374+ _pw.print(delimiter + colString + lnSprtr);
368375 }
369376 } else {
370377 if(isQuotation){
371- _pw.print("\"" + _splt + "\"" + colString);
378+ _pw.print("\"" + delimiter + "\"" + colString);
372379 } else {
373- _pw.print(_splt + colString);
380+ _pw.print(delimiter + colString);
374381 }
375382 }
376383
@@ -393,15 +400,15 @@ public class DataAccessObjects{
393400 }
394401 } else if (i == _lastCol){
395402 if(isQuotation){
396- _pw.print("\"" + _splt + "\"" + nullMark + "\"" + lnSprtr);
403+ _pw.print("\"" + delimiter + "\"" + nullMark + "\"" + lnSprtr);
397404 } else {
398- _pw.print(_splt + nullMark + lnSprtr);
405+ _pw.print(delimiter + nullMark + lnSprtr);
399406 }
400407 } else {
401408 if(isQuotation){
402- _pw.print("\"" + _splt + "\"" + nullMark);
409+ _pw.print("\"" + delimiter + "\"" + nullMark);
403410 } else {
404- _pw.print(_splt + nullMark);
411+ _pw.print(delimiter + nullMark);
405412 }
406413 }
407414 }
@@ -434,13 +441,6 @@ public class DataAccessObjects{
434441 Clob colClob = null;
435442 ByteArrayOutputStream baos = null;
436443 InputStream is = null;
437- if(!CmnUtils.isEmpty(prop_val[QUOTATION]) && prop_val[QUOTATION].toUpperCase().equals("N"))isQuotation = false;
438- if(!CmnUtils.isEmpty(prop_val[INCLCOLMASK]))isInclMaskCols = true;
439- if(!CmnUtils.isEmpty(prop_val[EXCLCOLMASK]))isExclMaskCols = true;
440- if(isInclMaskCols || isExclMaskCols)isMask = true;
441- if(!CmnUtils.isEmpty(prop_val[SBYTEMASKCHR]))singleByteChr = prop_val[SBYTEMASKCHR].charAt(0);
442- if(!CmnUtils.isEmpty(prop_val[DBYTEMASKCHR]))doubleByteChr = prop_val[DBYTEMASKCHR].charAt(0);
443- if(!CmnUtils.isEmpty(prop_val[MASKPTN]))maskPtn = prop_val[MASKPTN];
444444
445445 if (CmnUtils.isColString(_colTypeName)) {
446446 colString = _rst.getString(_rec_cnt);
--- a/com/rapide_act/RapideLoader.java
+++ b/com/rapide_act/RapideLoader.java
@@ -34,6 +34,7 @@ public class RapideLoader{
3434 private String url = null;
3535 private String driver = null;
3636 private String sql_table_list = null;
37+ private String sql_table_key_list = null;
3738 private static final int DB_TYPE_ORACLE = 0;
3839 private static final int DB_TYPE_SQLSERVER = 1;
3940 private static final int DB_TYPE_DB2 = 2;
@@ -44,9 +45,42 @@ public class RapideLoader{
4445 private static final int MASK_PTN_ALL = 0;
4546 private static final int MASK_PTN_ALT = 1;
4647 private static final int MASK_PTN_EDGE = 2;
48+ private static final int D_USER = 0;
49+ private static final int D_PASS = 1;
50+ private static final int D_URL = 2;
51+ private static final int D_DRIVER = 3;
52+ private static final int D_OUTPUT = 4;
53+ private static final int D_INPUT = 5;
54+ private static final int D_LINESEP = 6;
55+ private static final int D_INLINESEP = 7;
56+ private static final int D_FILENCODE = 8;
57+ private static final int D_NULLMARK = 9;
58+ private static final int D_DELIMITER = 10;
59+ private static final int D_TBLSQL = 11;
60+ private static final int D_TBLKEYSQL = 12;
61+ private static final int D_ORDER = 13;
62+ private static final int D_QUOTATION = 14;
63+ private static final int D_BATCOUNT = 15;
64+ private static final int D_INCLTAB = 16;
65+ private static final int D_EXCLTAB = 17;
66+ private static final int D_INCLCOL = 18;
67+ private static final int D_EXCLCOL = 19;
68+ private static final int D_INCLCOLMASK = 20;
69+ private static final int D_EXCLCOLMASK = 21;
70+ private static final int D_SBYTEMASKCHR = 22;
71+ private static final int D_DBYTEMASKCHR = 23;
72+ private static final int D_MASKPTN = 24;
73+ private static final int D_PROPFILE = 25;
74+ private static final int KEYS = 26;
75+ private static final String [] PROP_KEY = { "us","pw","url","dr","out","in","ls","ils","fe","nm",
76+ "dm","ts","tks","od","qt","bc","it","et","ic","ec",
77+ "icm","ecm","smc","dmc","mp","pf"};
78+
79+ private String [] prop_val = new String[KEYS];
4780 private static final String [] MASK_PTN = {"ALL", "ALT", "EDGE"};
48- private String propFile = "RapideLoader.properties";
49- private static String [] arySql_table_list = {
81+ private static final String DEFAULT_IN_FOLDER = "input";
82+ private static final String DEFAULT_PROP_FILE = "RapideLoader.properties";
83+ private static String [] sql_table_list_array = {
5084 "select "
5185 + " table_name "
5286 + " from user_tables "
@@ -57,6 +91,41 @@ public class RapideLoader{
5791 + " order by name"
5892 };
5993
94+ private boolean isLob = false;
95+ private boolean isContinue = false;
96+ private String nullMark = "";
97+ private boolean isOrder = false;
98+ private boolean isQuotation = true;
99+ private int batchCount = 1000;
100+ private boolean isInclTables = false;
101+ private boolean isExclTables = false;
102+ private boolean isInclCols = false;
103+ private boolean isExclCols = false;
104+ private boolean isMask = false;
105+ private boolean isInclColsMask = false;
106+ private boolean isExclColsMask = false;
107+ private String delimiter = "\t";
108+ private String lineSeparator = System.getProperty("line.separator");
109+ private String inColLineSeparator = System.getProperty("line.separator");
110+ private String outFolder = null;
111+ private String inFolder = null;
112+ private String inclTables = null;
113+ private String exclTables = null;
114+ private String inclCols = null;
115+ private String exclCols = null;
116+ private String inclColsMask = null;
117+ private String exclColsMask = null;
118+ private String [] inclTablesArray = null;
119+ private String [] exclTablesArray = null;
120+ private String [] inclColsArray = null;
121+ private String [] exclColsArray = null;
122+ private String [] inclColsMaskArray = null;
123+ private String [] exclColsMaskArray = null;
124+ private char singleByteMaskChar = '*';
125+ private char doubleByteMaskChar = '\u25A0';
126+ private String maskPattern = "ALT";
127+ private String fileEncoding = System.getProperty("file.encoding");
128+
60129 public static void main(String args[]){
61130 try {
62131 if (args.length > 0){
@@ -72,22 +141,17 @@ public class RapideLoader{
72141 }
73142
74143 private void getProperties(String _propFile) throws Exception{
75- InputStream is = null;
144+ BufferedReader br = null;
76145 Properties prop = null;
77146 try {
78147 prop = new Properties();
79- is = RapideLoader.class.getClassLoader().getResourceAsStream(_propFile);
80- prop.load(is);
81- driver = prop.getProperty(database + "." + "driver");
82- user = prop.getProperty(database + "." + "user");
83- pass = prop.getProperty(database + "." + "pass");
84- url = prop.getProperty(database + "." + "url");
85- CmnUtils.debugPrint("driver=" + driver);
86- CmnUtils.debugPrint("user=" + user);
87- CmnUtils.debugPrint("pass=" + pass);
88- CmnUtils.debugPrint("url=" + url);
89- is.close();
90- is = null;
148+ br = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(_propFile), "UTF-8"));
149+ prop.load(br);
150+ for(int i=0;i<KEYS;i++){
151+ prop_val[i] = prop.getProperty(database + "." +PROP_KEY[i]);
152+ }
153+ br.close();
154+ br = null;
91155 } catch (NullPointerException e) {
92156 throw new Exception("Property File (" + _propFile +") Not Found");
93157 } catch (IOException e) {
@@ -95,9 +159,9 @@ public class RapideLoader{
95159 }
96160 finally{
97161 try {
98- if (is != null) {
99- is.close();
100- is = null;
162+ if (br != null) {
163+ br.close();
164+ br = null;
101165 }
102166 }
103167 catch (IOException e) {
@@ -106,6 +170,7 @@ public class RapideLoader{
106170 }
107171 }
108172
173+
109174 RapideLoader(String _database) throws Exception{
110175 super();
111176 database = _database;
@@ -119,6 +184,15 @@ public class RapideLoader{
119184 String sql_load = null;
120185 String sql_insert = null;
121186 int dbType = DB_TYPE_UNKNOWN;
187+ String strLine = null;
188+ String strMltLine = null;
189+ String tbName = null;
190+ String [] flName = null;
191+ String [] colData = null;
192+ String [] colName = null;
193+ String [] colTypeName = null;
194+ Integer [] isNullable = null;
195+ Boolean [] colIncl = null;
122196
123197 File fldr = null;
124198 ArrayList<String> alData = null;
@@ -128,71 +202,64 @@ public class RapideLoader{
128202 ArrayList<Boolean> alColMask = null;
129203 ArrayList<Boolean> alColIncl = null;
130204
131- int batchCount = 1000;
132205 int tb_count = 0;
133206 int tb_col_count = 0;
134207 int fl_col_count = 0;
135208
136- String nullMark = "";
137- String strLine = null;
138- String strMltLine = null;
139- String tbName = null;
140- String [] flName = null;
141- String [] colData = null;
142- String [] colName = null;
143- String [] colTypeName = null;
144- Integer [] isNullable = null;
145- Boolean [] colIncl = null;
146- String sprtr = CmnUtils.getSeparator("sprtr", "\t");
147- String lnSprtr = CmnUtils.getLineSeparator("lnSprtr", System.getProperty("line.separator"));
148- String inColLnSprtr = CmnUtils.getLineSeparator("inColLnSprtr", System.getProperty("line.separator"));
149- String inclTables = System.getProperty("inclTables");
150- String exclTables = System.getProperty("exclTables");
151- String inclCols = System.getProperty("inclCols");
152- String exclCols = System.getProperty("exclCols");
153- String inclMaskCols = System.getProperty("inclMaskCols");
154- String exclMaskCols = System.getProperty("exclMaskCols");
155- String [] aryInclTables = CmnUtils.getSystemProperty("inclTables");
156- String [] aryExclTables = CmnUtils.getSystemProperty("exclTables");
157- String [] aryInclMaskCols = CmnUtils.getSystemProperty("inclMaskCols");
158- String [] aryExclMaskCols = CmnUtils.getSystemProperty("exclMaskCols");
159- String [] aryInclCols = CmnUtils.getSystemProperty("inclCols");
160- String [] aryExclCols = CmnUtils.getSystemProperty("exclCols");
161209
162- boolean isLob = false;
163- boolean isContinue = false;
164- boolean isQuotation = CmnUtils.getSystemProperty("quotation", true);
165- boolean isInclTables = CmnUtils.getSystemProperty("inclTables", false);
166- boolean isExclTables = CmnUtils.getSystemProperty("exclTables", false);
167- boolean isInclCols = CmnUtils.getSystemProperty("inclCols", false);
168- boolean isExclCols = CmnUtils.getSystemProperty("exclCols", false);
169- boolean isInclMaskCols = CmnUtils.getSystemProperty("inclMaskCols", false);
170- boolean isExclMaskCols = CmnUtils.getSystemProperty("exclMaskCols", false);
171- boolean isMask = CmnUtils.getSystemProperty("inclMaskCols", false) || CmnUtils.getSystemProperty("exclMaskCols", false);
172- String defaultFldr = "input";
173- String inFldr = System.getProperty("input");
174- char hankakuMask = CmnUtils.getSystemProperty("hankakuMask", '*');
175- char zenkakuMask = CmnUtils.getSystemProperty("zenkakuMask", '*');
176- String maskPtn = CmnUtils.getSystemProperty("maskPtn", MASK_PTN[MASK_PTN_ALT]);
177- String fileEncoding = CmnUtils.getSystemProperty("fileEncoding", System.getProperty("file.encoding"));
178210
179- if(System.getProperty("batchCount")!=null){
180- batchCount = Integer.parseInt(System.getProperty("batchCount"));
181- }
182211
183212 if(database != null){
184- if(System.getProperty("propFile") != null){
185- getProperties(System.getProperty("propFile"));
213+ if(!CmnUtils.isEmpty(prop_val[D_PROPFILE])){
214+ getProperties(System.getProperty(prop_val[D_PROPFILE]));
186215 } else {
187- getProperties(propFile);
216+ getProperties(DEFAULT_PROP_FILE);
188217 }
189- } else {
190- user = System.getProperty("user");
191- pass = System.getProperty("pass");
192- url = System.getProperty("url");
193- driver = System.getProperty("driver");
194-
195218 }
219+
220+ for(int i=0;i<KEYS;i++){
221+ if(System.getProperty(PROP_KEY[i])!=null)prop_val[i] = System.getProperty(PROP_KEY[i]);
222+ CmnUtils.debugPrint(PROP_KEY[i] + "=" + prop_val[i]);
223+ }
224+
225+ if(!CmnUtils.isEmpty(prop_val[D_USER]))user = prop_val[D_USER];
226+ if(!CmnUtils.isEmpty(prop_val[D_PASS]))pass = prop_val[D_PASS];
227+ if(!CmnUtils.isEmpty(prop_val[D_URL]))url = prop_val[D_URL];
228+ if(!CmnUtils.isEmpty(prop_val[D_DRIVER]))driver = prop_val[D_DRIVER];
229+ if(!CmnUtils.isEmpty(prop_val[D_OUTPUT]))outFolder = prop_val[D_OUTPUT];
230+ if(!CmnUtils.isEmpty(prop_val[D_INPUT]))inFolder = prop_val[D_INPUT];
231+ if(!CmnUtils.isEmpty(prop_val[D_LINESEP]))lineSeparator = CmnUtils.getLineSeparator(prop_val[D_LINESEP]);
232+ if(!CmnUtils.isEmpty(prop_val[D_INLINESEP]))inColLineSeparator = CmnUtils.getLineSeparator(prop_val[D_INLINESEP]);
233+ if(!CmnUtils.isEmpty(prop_val[D_FILENCODE]))fileEncoding = prop_val[D_FILENCODE];
234+ if(!CmnUtils.isEmpty(prop_val[D_NULLMARK]))nullMark = prop_val[D_NULLMARK];
235+ if(!CmnUtils.isEmpty(prop_val[D_DELIMITER]))delimiter = CmnUtils.getDelimiter(prop_val[D_DELIMITER]);
236+ if(!CmnUtils.isEmpty(prop_val[D_TBLSQL]))sql_table_list = prop_val[D_TBLSQL];
237+ if(!CmnUtils.isEmpty(prop_val[D_TBLKEYSQL]))sql_table_key_list = prop_val[D_TBLKEYSQL];
238+ if(!CmnUtils.isEmpty(prop_val[D_ORDER]) && prop_val[D_ORDER].toUpperCase().equals("Y"))isOrder = true;
239+ if(!CmnUtils.isEmpty(prop_val[D_QUOTATION]) && prop_val[D_QUOTATION].toUpperCase().equals("N"))isQuotation = false;
240+ if(!CmnUtils.isEmpty(prop_val[D_BATCOUNT]))batchCount = Integer.parseInt(prop_val[D_BATCOUNT]);
241+ if(!CmnUtils.isEmpty(prop_val[D_INCLTAB]))isInclTables = true;
242+ if(!CmnUtils.isEmpty(prop_val[D_EXCLTAB]))isExclTables = true;
243+ if(!CmnUtils.isEmpty(prop_val[D_INCLCOL]))isInclCols = true;
244+ if(!CmnUtils.isEmpty(prop_val[D_EXCLCOL]))isExclCols = true;
245+ if(!CmnUtils.isEmpty(prop_val[D_INCLCOLMASK]))isInclColsMask = true;
246+ if(!CmnUtils.isEmpty(prop_val[D_EXCLCOLMASK]))isExclColsMask = true;
247+ if(isInclColsMask || isExclColsMask)isMask = true;
248+ if(!CmnUtils.isEmpty(prop_val[D_INCLTAB]))inclTables = prop_val[D_INCLTAB].toUpperCase();
249+ if(!CmnUtils.isEmpty(prop_val[D_EXCLTAB]))exclTables = prop_val[D_EXCLTAB].toUpperCase();
250+ if(!CmnUtils.isEmpty(prop_val[D_INCLCOL]))inclCols = prop_val[D_INCLCOL].toUpperCase();
251+ if(!CmnUtils.isEmpty(prop_val[D_EXCLCOL]))exclCols = prop_val[D_EXCLCOL].toUpperCase();
252+ if(!CmnUtils.isEmpty(prop_val[D_INCLCOLMASK]))inclColsMask = prop_val[D_INCLCOLMASK].toUpperCase();
253+ if(!CmnUtils.isEmpty(prop_val[D_EXCLCOLMASK]))exclColsMask = prop_val[D_EXCLCOLMASK].toUpperCase();
254+ if(!CmnUtils.isEmpty(prop_val[D_INCLTAB]))inclTablesArray = CmnUtils.splitCsv(prop_val[D_INCLTAB].toUpperCase());
255+ if(!CmnUtils.isEmpty(prop_val[D_EXCLTAB]))exclTablesArray = CmnUtils.splitCsv(prop_val[D_EXCLTAB].toUpperCase());
256+ if(!CmnUtils.isEmpty(prop_val[D_INCLCOL]))inclColsArray = CmnUtils.splitCsv(prop_val[D_INCLCOL].toUpperCase());
257+ if(!CmnUtils.isEmpty(prop_val[D_EXCLCOL]))exclColsArray = CmnUtils.splitCsv(prop_val[D_EXCLCOL].toUpperCase());
258+ if(!CmnUtils.isEmpty(prop_val[D_INCLCOLMASK]))inclColsMaskArray = CmnUtils.splitCsv(prop_val[D_INCLCOLMASK].toUpperCase());
259+ if(!CmnUtils.isEmpty(prop_val[D_EXCLCOLMASK]))exclColsMaskArray = CmnUtils.splitCsv(prop_val[D_EXCLCOLMASK].toUpperCase());
260+ if(!CmnUtils.isEmpty(prop_val[D_SBYTEMASKCHR]))singleByteMaskChar = prop_val[D_SBYTEMASKCHR].charAt(0);
261+ if(!CmnUtils.isEmpty(prop_val[D_DBYTEMASKCHR]))doubleByteMaskChar = prop_val[D_DBYTEMASKCHR].charAt(0);
262+ if(!CmnUtils.isEmpty(prop_val[D_MASKPTN]))maskPattern = prop_val[D_MASKPTN];
196263
197264 if(user == null){
198265 throw new Exception("user is null");
@@ -212,10 +279,10 @@ public class RapideLoader{
212279 }
213280
214281 if (dbType != DB_TYPE_UNKNOWN){
215- if(System.getProperty("sql_table_list") != null){
216- sql_table_list = System.getProperty("sql_table_list");
282+ if(!CmnUtils.isEmpty(prop_val[D_TBLSQL])){
283+ sql_table_list = prop_val[D_TBLSQL];
217284 } else {
218- sql_table_list = arySql_table_list[dbType];
285+ sql_table_list = sql_table_list_array[dbType];
219286 }
220287 } else {
221288 throw new Exception("dbtype unknown");
@@ -226,18 +293,18 @@ public class RapideLoader{
226293 conn = dao.connect();
227294 conn.setAutoCommit(false);
228295
229- if(inFldr != null){
230- fldr = new File(inFldr);
296+ if(inFolder != null){
297+ fldr = new File(inFolder);
231298 } else {
232299 if (database != null){
233- fldr = new File(defaultFldr + "/" + database.toUpperCase());
300+ fldr = new File(DEFAULT_IN_FOLDER + "/" + database.toUpperCase());
234301 } else {
235- fldr = new File(defaultFldr + "/" + DB_TYPE_NAME[dbType].toUpperCase());
302+ fldr = new File(DEFAULT_IN_FOLDER + "/" + DB_TYPE_NAME[dbType].toUpperCase());
236303 }
237304 }
238305 CmnUtils.infoPrint("-->対象データベース='" + database.toUpperCase() + "'");
239306 CmnUtils.infoPrint("-->入力元='" + fldr + "'");
240- CmnUtils.infoPrint("-->区切り文字='" + sprtr + "'");
307+ CmnUtils.infoPrint("-->区切り文字='" + delimiter + "'");
241308 CmnUtils.infoPrint("-->バッチカウント=" + batchCount);
242309 CmnUtils.infoPrint("-->引用句=" + CmnUtils.getYesNo(isQuotation));
243310 if(isInclTables)CmnUtils.infoPrint("-->対象テーブル='" + inclTables.toUpperCase() + "'");
@@ -246,11 +313,11 @@ public class RapideLoader{
246313 if(isExclCols)CmnUtils.infoPrint("-->除外カラム='" + exclCols.toUpperCase() + "'");
247314 CmnUtils.infoPrint("-->マスキング=" + CmnUtils.getYesNo(isMask));
248315 if(isMask){
249- CmnUtils.infoPrint("-->マスクキングパターン=" + maskPtn.toUpperCase());
250- if(isInclMaskCols)CmnUtils.infoPrint("-->マスク対象カラム='" + inclMaskCols.toUpperCase() + "'");
251- if(isExclMaskCols)CmnUtils.infoPrint("-->マスク除外カラム='" + exclMaskCols.toUpperCase() + "'");
252- CmnUtils.infoPrint("-->半角マスク文字='" + hankakuMask + "'");
253- CmnUtils.infoPrint("-->全角マスク文字='" + zenkakuMask + "'");
316+ CmnUtils.infoPrint("-->マスクキングパターン=" + maskPattern.toUpperCase());
317+ if(isInclColsMask)CmnUtils.infoPrint("-->マスク対象カラム='" + inclColsMask.toUpperCase() + "'");
318+ if(isExclColsMask)CmnUtils.infoPrint("-->マスク除外カラム='" + exclColsMask.toUpperCase() + "'");
319+ CmnUtils.infoPrint("-->半角マスク文字='" + singleByteMaskChar + "'");
320+ CmnUtils.infoPrint("-->全角マスク文字='" + doubleByteMaskChar + "'");
254321 }
255322 CmnUtils.infoPrint("データロードを開始しました。");
256323
@@ -270,14 +337,14 @@ public class RapideLoader{
270337 TABLE_LOOP:
271338 for(int i=0;i<alData.size();i++){
272339 if(tbName.equals(alData.get(i))){
273- if(isInclTables && !CmnUtils.isMatch(aryInclTables,tbName.toUpperCase())){
340+ if(isInclTables && !CmnUtils.isMatch(inclTablesArray,tbName.toUpperCase())){
274341 CmnUtils.debugPrint("inclTables=" + inclTables);
275- CmnUtils.debugPrint("table=" + tbName + "," +CmnUtils.isMatch(aryInclTables,tbName.toUpperCase()));
342+ CmnUtils.debugPrint("table=" + tbName + "," +CmnUtils.isMatch(inclTablesArray,tbName.toUpperCase()));
276343 continue;
277344 }
278- if(isExclTables && CmnUtils.isMatch(aryExclTables,tbName.toUpperCase())){
345+ if(isExclTables && CmnUtils.isMatch(exclTablesArray,tbName.toUpperCase())){
279346 CmnUtils.debugPrint("exclTables=" + exclTables);
280- CmnUtils.debugPrint("table=" + tbName + "," +CmnUtils.isMatch(aryExclTables,tbName.toUpperCase()));
347+ CmnUtils.debugPrint("table=" + tbName + "," +CmnUtils.isMatch(exclTablesArray,tbName.toUpperCase()));
281348 continue;
282349 }
283350 br = new BufferedReader(new InputStreamReader(new FileInputStream(fldr + "/" + alData.get(i) + "." + flName[1]), fileEncoding));
@@ -309,9 +376,9 @@ public class RapideLoader{
309376 while((strLine=br.readLine()) != null){
310377 if (fl_rec_count == 0){
311378 if(isQuotation){
312- colData = CmnUtils.split(strLine,"\"" + sprtr + "\"");
379+ colData = CmnUtils.split(strLine,"\"" + delimiter + "\"");
313380 } else {
314- colData = CmnUtils.split(strLine,sprtr);
381+ colData = CmnUtils.split(strLine,delimiter);
315382 }
316383 fl_col_count = colData.length;
317384 fl_col_seq = new int[colData.length];
@@ -324,16 +391,16 @@ public class RapideLoader{
324391 if(
325392 (isInclCols &&
326393 !isExclCols &&
327- CmnUtils.isMatch(aryInclCols, tbName.toUpperCase(), colName[l].toUpperCase())
394+ CmnUtils.isMatch(inclColsArray, tbName.toUpperCase(), colName[l].toUpperCase())
328395 ) ||
329396 (isInclCols &&
330397 isExclCols &&
331- CmnUtils.isMatch(aryInclCols, tbName.toUpperCase(), colName[l].toUpperCase()) &&
332- !CmnUtils.isMatch(aryExclCols, tbName.toUpperCase(), colName[l].toUpperCase())
398+ CmnUtils.isMatch(inclColsArray, tbName.toUpperCase(), colName[l].toUpperCase()) &&
399+ !CmnUtils.isMatch(exclColsArray, tbName.toUpperCase(), colName[l].toUpperCase())
333400 ) ||
334401 (!isInclCols &&
335402 isExclCols &&
336- !CmnUtils.isMatch(aryExclCols, tbName.toUpperCase(), colName[l].toUpperCase())
403+ !CmnUtils.isMatch(exclColsArray, tbName.toUpperCase(), colName[l].toUpperCase())
337404 )
338405 ){
339406 CmnUtils.debugPrint("対象カラム=" + colName[l].toUpperCase());
@@ -398,9 +465,9 @@ public class RapideLoader{
398465 }
399466 } else {
400467 if(isQuotation){
401- colData = CmnUtils.split(strLine,"\"" + sprtr + "\"");
468+ colData = CmnUtils.split(strLine,"\"" + delimiter + "\"");
402469 } else {
403- colData = CmnUtils.split(strLine,sprtr);
470+ colData = CmnUtils.split(strLine,delimiter);
404471 }
405472 if(colData.length == fl_col_count){
406473 if(!strMltLine.equals("")){
@@ -424,11 +491,11 @@ public class RapideLoader{
424491 strMltLine += strLine;
425492 isContinue = true;
426493 } else {
427- strMltLine += inColLnSprtr + strLine;
494+ strMltLine += inColLineSeparator + strLine;
428495 if(isQuotation){
429- colData = CmnUtils.split(strMltLine,"\"" + sprtr + "\"");
496+ colData = CmnUtils.split(strMltLine,"\"" + delimiter + "\"");
430497 } else {
431- colData = CmnUtils.split(strMltLine,sprtr);
498+ colData = CmnUtils.split(strMltLine,delimiter);
432499 }
433500 if(colData.length == fl_col_count){
434501 isContinue = false;
@@ -465,33 +532,33 @@ public class RapideLoader{
465532 if (CmnUtils.isColString(colTypeName[tb_col_seq[j]])){
466533 if(isMask){
467534 if(
468- (isInclMaskCols &&
469- !isExclMaskCols &&
470- CmnUtils.isMatch(aryInclMaskCols,tbName.toUpperCase(), colName[tb_col_seq[j]].toUpperCase())
535+ (isInclColsMask &&
536+ !isExclColsMask &&
537+ CmnUtils.isMatch(inclColsMaskArray,tbName.toUpperCase(), colName[tb_col_seq[j]].toUpperCase())
471538 ) ||
472- (isInclMaskCols &&
473- isExclMaskCols &&
474- CmnUtils.isMatch(aryInclMaskCols,tbName.toUpperCase(), colName[tb_col_seq[j]].toUpperCase()) &&
475- !CmnUtils.isMatch(aryExclMaskCols,tbName.toUpperCase(),colName[tb_col_seq[j]].toUpperCase())
539+ (isInclColsMask &&
540+ isExclColsMask &&
541+ CmnUtils.isMatch(inclColsMaskArray,tbName.toUpperCase(), colName[tb_col_seq[j]].toUpperCase()) &&
542+ !CmnUtils.isMatch(exclColsMaskArray,tbName.toUpperCase(),colName[tb_col_seq[j]].toUpperCase())
476543 ) ||
477- (!isInclMaskCols &&
478- isExclMaskCols &&
479- !CmnUtils.isMatch(aryExclMaskCols,tbName.toUpperCase(),colName[tb_col_seq[j]].toUpperCase())
544+ (!isInclColsMask &&
545+ isExclColsMask &&
546+ !CmnUtils.isMatch(exclColsMaskArray,tbName.toUpperCase(),colName[tb_col_seq[j]].toUpperCase())
480547 )
481548 ){
482549 StringBuffer sb = new StringBuffer();
483550 for(int l=0;l<colData[fl_col_seq[j]].length();l++){
484- if((maskPtn.toUpperCase().equals(MASK_PTN[MASK_PTN_ALT]) &&
551+ if((maskPattern.toUpperCase().equals(MASK_PTN[MASK_PTN_ALT]) &&
485552 (l % 2) == 1) ||
486- (maskPtn.toUpperCase().equals(MASK_PTN[MASK_PTN_EDGE]) &&
553+ (maskPattern.toUpperCase().equals(MASK_PTN[MASK_PTN_EDGE]) &&
487554 !(l == 0 || j == colData[fl_col_seq[j]].length() - 1) ||
488- (maskPtn.toUpperCase().equals(MASK_PTN[MASK_PTN_ALL]))
555+ (maskPattern.toUpperCase().equals(MASK_PTN[MASK_PTN_ALL]))
489556 )
490557 ){
491558 if(CmnUtils.isHankaku(colData[fl_col_seq[j]].charAt(l))){
492- sb.append(hankakuMask);
559+ sb.append(singleByteMaskChar);
493560 } else {
494- sb.append(zenkakuMask);
561+ sb.append(doubleByteMaskChar);
495562 }
496563 } else {
497564 sb.append(colData[fl_col_seq[j]].charAt(l));
--- a/com/rapide_act/RapideUnloader.java
+++ b/com/rapide_act/RapideUnloader.java
@@ -34,78 +34,87 @@ public class RapideUnloader{
3434 private String user = null;
3535 private String pass = null;
3636 private String url = null;
37- private String sql_table_list;
37+ private String sql_table_key_list;
3838 private static final int DB_TYPE_ORACLE = 0;
3939 private static final int DB_TYPE_SQLSERVER = 1;
4040 private static final int DB_TYPE_DB2 = 2;
4141 private static final int DB_TYPE_MYSQL = 3;
4242 private static final int DB_TYPE_POSTGRESQL = 4;
4343 private static final int DB_TYPE_UNKNOWN = -1;
44- private static final String [] DB_TYPE_NAME = {"ORACLE", "SQLSERVER", "DB2", "MYSQL", "POSTGRESQL"};
4544 private static final int MASK_PTN_ALL = 0;
4645 private static final int MASK_PTN_ALT = 1;
4746 private static final int MASK_PTN_EDGE = 2;
48- private static final String [] MASK_PTN = {"ALL", "ALT", "EDGE"};
49- private static final int USER = 0;
50- private static final int PASS = 1;
51- private static final int URL = 2;
52- private static final int DRIVER = 3;
53- private static final int OUTPUT = 4;
54- private static final int INPUT = 5;
55- private static final int LINESEP = 6;
56- private static final int INLINESEP = 7;
57- private static final int FILENCODE = 8;
58- private static final int NULLMARK = 9;
59- private static final int DELIMITER = 10;
60- private static final int TBLSQL = 11;
61- private static final int TBLKEYSQL = 12;
62- private static final int ORDER = 13;
63- private static final int QUOTATION = 14;
64- private static final int BATCOUNT = 15;
65- private static final int INCLTAB = 16;
66- private static final int EXCLTAB = 17;
67- private static final int INCLCOL = 18;
68- private static final int EXCLCOL = 19;
69- private static final int INCLCOLMASK = 20;
70- private static final int EXCLCOLMASK = 21;
71- private static final int SBYTEMASKCHR = 22;
72- private static final int DBYTEMASKCHR = 23;
73- private static final int MASKPTN = 24;
74- private static final int PROPFILE = 25;
75- private static final String [] PROP_KEY = {
76- "us",
77- "pw",
78- "url",
79- "dr",
80- "out",
81- "in",
82- "ls",
83- "ils",
84- "fe",
85- "nm",
86- "dm",
87- "ts",
88- "tks",
89- "od",
90- "qt",
91- "bc",
92- "it",
93- "et",
94- "ic",
95- "ec",
96- "icm",
97- "ecm",
98- "smc",
99- "dmc",
100- "mp",
101- "pf"
102- };
47+ private static final int D_USER = 0;
48+ private static final int D_PASS = 1;
49+ private static final int D_URL = 2;
50+ private static final int D_DRIVER = 3;
51+ private static final int D_OUTPUT = 4;
52+ private static final int D_INPUT = 5;
53+ private static final int D_LINESEP = 6;
54+ private static final int D_INLINESEP = 7;
55+ private static final int D_FILENCODE = 8;
56+ private static final int D_NULLMARK = 9;
57+ private static final int D_DELIMITER = 10;
58+ private static final int D_TBLSQL = 11;
59+ private static final int D_TBLKEYSQL = 12;
60+ private static final int D_ORDER = 13;
61+ private static final int D_QUOTATION = 14;
62+ private static final int D_BATCOUNT = 15;
63+ private static final int D_INCLTAB = 16;
64+ private static final int D_EXCLTAB = 17;
65+ private static final int D_INCLCOL = 18;
66+ private static final int D_EXCLCOL = 19;
67+ private static final int D_INCLCOLMASK = 20;
68+ private static final int D_EXCLCOLMASK = 21;
69+ private static final int D_SBYTEMASKCHR = 22;
70+ private static final int D_DBYTEMASKCHR = 23;
71+ private static final int D_MASKPTN = 24;
72+ private static final int D_PROPFILE = 25;
10373 private static final int KEYS = 26;
74+ private static final String [] DB_TYPE_NAME = {"ORACLE", "SQLSERVER", "DB2", "MYSQL", "POSTGRESQL"};
75+ private static final String [] MASK_PTN = {"ALL", "ALT", "EDGE"};
76+ private static final String [] PROP_KEY = { "us","pw","url","dr","out","in","ls","ils","fe","nm",
77+ "dm","ts","tks","od","qt","bc","it","et","ic","ec",
78+ "icm","ecm","smc","dmc","mp","pf"};
79+ private static final String DEFAULT_FOLDER = "output";
80+ private static final String DEFAULT_PROP_FILE = "RapideLoader.properties";
81+
82+ private String nullMark = "";
83+ private boolean isOrder = false;
84+ private boolean isQuotation = true;
85+ private boolean isInclTables = false;
86+ private boolean isExclTables = false;
87+ private boolean isInclCols = false;
88+ private boolean isExclCols = false;
89+ private boolean isMask = false;
90+ private boolean isInclColsMask = false;
91+ private boolean isExclColsMask = false;
92+ private String delimiter = "\t";
93+ private String lineSeparator = System.getProperty("line.separator");
94+ private String inColLineSeparator = System.getProperty("line.separator");
95+ private String outFolder = null;
96+ private String inFolder = null;
97+ private String inclTables = null;
98+ private String exclTables = null;
99+ private String inclCols = null;
100+ private String exclCols = null;
101+ private String inclMaskCols = null;
102+ private String exclMaskCols = null;
103+ private String [] inclTablesArray = null;
104+ private String [] exclTablesArray = null;
105+ private String [] inclColsArray = null;
106+ private String [] exclColsArray = null;
107+ private String [] inclColsMaskArray = null;
108+ private String [] exclColsMaskArray = null;
109+ private char singleByteMaskChar = '*';
110+ private char doubleByteMaskChar = '\u25A0';
111+ private String maskPattern = "ALT";
112+ private String fileEncoding = System.getProperty("file.encoding");
113+
104114 private String [] prop_val = new String[KEYS];
105115
106- private String propFile = "RapideLoader.properties";
107116
108- private static String [] arySql_table_list = {
117+ private static String [] sql_table_key_list_array = {
109118 "select "
110119 + "a.table_name,"
111120 + "d.column_name "
@@ -162,7 +171,7 @@ public class RapideUnloader{
162171 Properties prop = null;
163172 try {
164173 prop = new Properties();
165- br = new BufferedReader(new InputStreamReader(new FileInputStream(_propFile), "UTF-8"));
174+ br = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(_propFile), "UTF-8"));
166175 prop.load(br);
167176 for(int i=0;i<KEYS;i++){
168177 prop_val[i] = prop.getProperty(database + "." +PROP_KEY[i]);
@@ -208,41 +217,13 @@ public class RapideUnloader{
208217 int tb_count = 0;
209218 int tb_col_count = 0;
210219
211- boolean isOrder = false;
212- boolean isQuotation = true;
213- boolean isInclTables = false;
214- boolean isExclTables = false;
215- boolean isInclCols = false;
216- boolean isExclCols = false;
217- boolean isMask = false;
218- boolean isInclMaskCols = false;
219- boolean isExclMaskCols = false;
220- String dlmtr = "\t";
221- String lnSprtr = System.getProperty("line.separator");
222- String defaultFldr = "output";
223- String outFldr = null;
224- String inclTables = null;
225- String exclTables = null;
226- String inclCols = null;
227- String exclCols = null;
228- String inclMaskCols = null;
229- String exclMaskCols = null;
230- String [] aryInclTables = null;
231- String [] aryExclTables = null;
232- String [] aryInclMaskCols = null;
233- String [] aryExclMaskCols = null;
234- String [] aryInclCols = null;
235- String [] aryExclCols = null;
236- char SingleByteChr = '*';
237- char DoubleByteChr = '*';
238- String maskPtn = "ALT";
239- String fileEncoding = System.getProperty("file.encoding");
220+
240221
241222 if(database != null){
242- if(System.getProperty("pf") != null){
243- getProperties(System.getProperty("pf"));
223+ if(!CmnUtils.isEmpty(prop_val[D_PROPFILE])){
224+ getProperties(System.getProperty(prop_val[D_PROPFILE]));
244225 } else {
245- getProperties(propFile);
226+ getProperties(DEFAULT_PROP_FILE);
246227 }
247228 }
248229
@@ -251,38 +232,38 @@ public class RapideUnloader{
251232 CmnUtils.debugPrint(PROP_KEY[i] + "=" + prop_val[i]);
252233 }
253234
254- if(!CmnUtils.isEmpty(prop_val[USER]))user = prop_val[USER];
255- if(!CmnUtils.isEmpty(prop_val[PASS]))pass = prop_val[PASS];
256- if(!CmnUtils.isEmpty(prop_val[URL]))url = prop_val[URL];
257- if(!CmnUtils.isEmpty(prop_val[DRIVER]))driver = prop_val[DRIVER];
258- if(!CmnUtils.isEmpty(prop_val[ORDER]) && prop_val[ORDER].toUpperCase().equals("Y"))isOrder = true;
259- if(!CmnUtils.isEmpty(prop_val[QUOTATION]) && prop_val[QUOTATION].toUpperCase().equals("N"))isQuotation = false;
260- if(!CmnUtils.isEmpty(prop_val[INCLTAB]))isInclTables = true;
261- if(!CmnUtils.isEmpty(prop_val[EXCLTAB]))isExclTables = true;
262- if(!CmnUtils.isEmpty(prop_val[INCLCOL]))isInclCols = true;
263- if(!CmnUtils.isEmpty(prop_val[EXCLCOL]))isExclCols = true;
264- if(!CmnUtils.isEmpty(prop_val[INCLCOLMASK]))isInclMaskCols = true;
265- if(!CmnUtils.isEmpty(prop_val[EXCLCOLMASK]))isExclMaskCols = true;
266- if(isInclMaskCols || isExclMaskCols)isMask = true;
267- if(!CmnUtils.isEmpty(prop_val[DELIMITER]))dlmtr = CmnUtils.getDelimiter(prop_val[DELIMITER]);
268- if(!CmnUtils.isEmpty(prop_val[LINESEP]))lnSprtr = CmnUtils.getLineSeparator(prop_val[LINESEP]);
269- if(!CmnUtils.isEmpty(prop_val[OUTPUT]))outFldr = prop_val[OUTPUT];
270- if(!CmnUtils.isEmpty(prop_val[INCLTAB]))inclTables = prop_val[INCLTAB].toUpperCase();
271- if(!CmnUtils.isEmpty(prop_val[EXCLTAB]))exclTables = prop_val[EXCLTAB].toUpperCase();
272- if(!CmnUtils.isEmpty(prop_val[INCLCOL]))inclCols = prop_val[INCLCOL].toUpperCase();
273- if(!CmnUtils.isEmpty(prop_val[EXCLCOL]))exclCols = prop_val[EXCLCOL].toUpperCase();
274- if(!CmnUtils.isEmpty(prop_val[INCLCOLMASK]))inclMaskCols = prop_val[INCLCOLMASK].toUpperCase();
275- if(!CmnUtils.isEmpty(prop_val[EXCLCOLMASK]))exclMaskCols = prop_val[EXCLCOLMASK].toUpperCase();
276- if(!CmnUtils.isEmpty(prop_val[INCLTAB]))aryInclTables = CmnUtils.splitCsv(prop_val[INCLTAB].toUpperCase());
277- if(!CmnUtils.isEmpty(prop_val[EXCLTAB]))aryExclTables = CmnUtils.splitCsv(prop_val[EXCLTAB].toUpperCase());
278- if(!CmnUtils.isEmpty(prop_val[INCLCOL]))aryInclCols = CmnUtils.splitCsv(prop_val[INCLCOL].toUpperCase());
279- if(!CmnUtils.isEmpty(prop_val[EXCLCOL]))aryExclCols = CmnUtils.splitCsv(prop_val[EXCLCOL].toUpperCase());
280- if(!CmnUtils.isEmpty(prop_val[INCLCOLMASK]))aryInclMaskCols = CmnUtils.splitCsv(prop_val[INCLCOLMASK].toUpperCase());
281- if(!CmnUtils.isEmpty(prop_val[EXCLCOLMASK]))aryExclMaskCols = CmnUtils.splitCsv(prop_val[EXCLCOLMASK].toUpperCase());
282- if(!CmnUtils.isEmpty(prop_val[SBYTEMASKCHR]))SingleByteChr = prop_val[SBYTEMASKCHR].charAt(0);
283- if(!CmnUtils.isEmpty(prop_val[DBYTEMASKCHR]))DoubleByteChr = prop_val[DBYTEMASKCHR].charAt(0);
284- if(!CmnUtils.isEmpty(prop_val[MASKPTN]))maskPtn = prop_val[MASKPTN];
285- if(!CmnUtils.isEmpty(prop_val[FILENCODE]))fileEncoding = prop_val[FILENCODE];
235+ if(!CmnUtils.isEmpty(prop_val[D_USER]))user = prop_val[D_USER];
236+ if(!CmnUtils.isEmpty(prop_val[D_PASS]))pass = prop_val[D_PASS];
237+ if(!CmnUtils.isEmpty(prop_val[D_URL]))url = prop_val[D_URL];
238+ if(!CmnUtils.isEmpty(prop_val[D_DRIVER]))driver = prop_val[D_DRIVER];
239+ if(!CmnUtils.isEmpty(prop_val[D_ORDER]) && prop_val[D_ORDER].toUpperCase().equals("Y"))isOrder = true;
240+ if(!CmnUtils.isEmpty(prop_val[D_QUOTATION]) && prop_val[D_QUOTATION].toUpperCase().equals("N"))isQuotation = false;
241+ if(!CmnUtils.isEmpty(prop_val[D_INCLTAB]))isInclTables = true;
242+ if(!CmnUtils.isEmpty(prop_val[D_EXCLTAB]))isExclTables = true;
243+ if(!CmnUtils.isEmpty(prop_val[D_INCLCOL]))isInclCols = true;
244+ if(!CmnUtils.isEmpty(prop_val[D_EXCLCOL]))isExclCols = true;
245+ if(!CmnUtils.isEmpty(prop_val[D_INCLCOLMASK]))isInclColsMask = true;
246+ if(!CmnUtils.isEmpty(prop_val[D_EXCLCOLMASK]))isExclColsMask = true;
247+ if(isInclColsMask || isExclColsMask)isMask = true;
248+ if(!CmnUtils.isEmpty(prop_val[D_DELIMITER]))delimiter = CmnUtils.getDelimiter(prop_val[D_DELIMITER]);
249+ if(!CmnUtils.isEmpty(prop_val[D_LINESEP]))lineSeparator = CmnUtils.getLineSeparator(prop_val[D_LINESEP]);
250+ if(!CmnUtils.isEmpty(prop_val[D_OUTPUT]))outFolder = prop_val[D_OUTPUT];
251+ if(!CmnUtils.isEmpty(prop_val[D_INCLTAB]))inclTables = prop_val[D_INCLTAB].toUpperCase();
252+ if(!CmnUtils.isEmpty(prop_val[D_EXCLTAB]))exclTables = prop_val[D_EXCLTAB].toUpperCase();
253+ if(!CmnUtils.isEmpty(prop_val[D_INCLCOL]))inclCols = prop_val[D_INCLCOL].toUpperCase();
254+ if(!CmnUtils.isEmpty(prop_val[D_EXCLCOL]))exclCols = prop_val[D_EXCLCOL].toUpperCase();
255+ if(!CmnUtils.isEmpty(prop_val[D_INCLCOLMASK]))inclMaskCols = prop_val[D_INCLCOLMASK].toUpperCase();
256+ if(!CmnUtils.isEmpty(prop_val[D_EXCLCOLMASK]))exclMaskCols = prop_val[D_EXCLCOLMASK].toUpperCase();
257+ if(!CmnUtils.isEmpty(prop_val[D_INCLTAB]))inclTablesArray = CmnUtils.splitCsv(prop_val[D_INCLTAB].toUpperCase());
258+ if(!CmnUtils.isEmpty(prop_val[D_EXCLTAB]))exclTablesArray = CmnUtils.splitCsv(prop_val[D_EXCLTAB].toUpperCase());
259+ if(!CmnUtils.isEmpty(prop_val[D_INCLCOL]))inclColsArray = CmnUtils.splitCsv(prop_val[D_INCLCOL].toUpperCase());
260+ if(!CmnUtils.isEmpty(prop_val[D_EXCLCOL]))exclColsArray = CmnUtils.splitCsv(prop_val[D_EXCLCOL].toUpperCase());
261+ if(!CmnUtils.isEmpty(prop_val[D_INCLCOLMASK]))inclColsMaskArray = CmnUtils.splitCsv(prop_val[D_INCLCOLMASK].toUpperCase());
262+ if(!CmnUtils.isEmpty(prop_val[D_EXCLCOLMASK]))exclColsMaskArray = CmnUtils.splitCsv(prop_val[D_EXCLCOLMASK].toUpperCase());
263+ if(!CmnUtils.isEmpty(prop_val[D_SBYTEMASKCHR]))singleByteMaskChar = prop_val[D_SBYTEMASKCHR].charAt(0);
264+ if(!CmnUtils.isEmpty(prop_val[D_DBYTEMASKCHR]))doubleByteMaskChar = prop_val[D_DBYTEMASKCHR].charAt(0);
265+ if(!CmnUtils.isEmpty(prop_val[D_MASKPTN]))maskPattern = prop_val[D_MASKPTN];
266+ if(!CmnUtils.isEmpty(prop_val[D_FILENCODE]))fileEncoding = prop_val[D_FILENCODE];
286267
287268 if(user == null){
288269 throw new Exception("user is null");
@@ -302,10 +283,10 @@ public class RapideUnloader{
302283 }
303284
304285 if (dbType != DB_TYPE_UNKNOWN){
305- if(!CmnUtils.isEmpty(prop_val[TBLKEYSQL])){
306- sql_table_list = prop_val[TBLKEYSQL];
286+ if(!CmnUtils.isEmpty(prop_val[D_TBLKEYSQL])){
287+ sql_table_key_list = prop_val[D_TBLKEYSQL];
307288 } else {
308- sql_table_list = arySql_table_list[dbType];
289+ sql_table_key_list = sql_table_key_list_array[dbType];
309290 }
310291 } else {
311292 throw new Exception("dbtype unknown");
@@ -316,39 +297,39 @@ public class RapideUnloader{
316297 try {
317298 conn = dao.connect();
318299
319- if(outFldr != null){
320- fldr = new File(outFldr);
300+ if(outFolder != null){
301+ fldr = new File(outFolder);
321302 } else {
322303 if(database != null){
323- fldr = new File(defaultFldr + "/" + database.toUpperCase() + "_" + CmnUtils.getYmdhm());
304+ fldr = new File(DEFAULT_FOLDER + "/" + database.toUpperCase() + "_" + CmnUtils.getYmdhm());
324305 } else {
325- fldr = new File(defaultFldr + "/" + DB_TYPE_NAME[dbType].toUpperCase() + "_" + CmnUtils.getYmdhm());
306+ fldr = new File(DEFAULT_FOLDER + "/" + DB_TYPE_NAME[dbType].toUpperCase() + "_" + CmnUtils.getYmdhm());
326307 }
327308 fldr.mkdir();
328309 }
329310
330311 if(database!=null)CmnUtils.infoPrint("-->Database='" + database.toUpperCase() + "'");
331312 CmnUtils.infoPrint("-->Output='" + fldr + "'");
332- if(!CmnUtils.isEmpty(prop_val[DELIMITER]))CmnUtils.infoPrint("-->Delimiter='" + prop_val[DELIMITER] + "'");
333- if(!CmnUtils.isEmpty(prop_val[LINESEP]))CmnUtils.infoPrint("-->LineSeparator='" + prop_val[LINESEP] + "'");
334- if(!CmnUtils.isEmpty(prop_val[FILENCODE]))CmnUtils.infoPrint("-->FileEncoding='" + prop_val[FILENCODE] + "'");
335- if(!CmnUtils.isEmpty(prop_val[QUOTATION]))CmnUtils.infoPrint("-->Quotation=" + CmnUtils.getYesNo(isQuotation));
336- if(!CmnUtils.isEmpty(prop_val[ORDER]))CmnUtils.infoPrint("-->Sort=" + CmnUtils.getYesNo(isOrder));
313+ if(!CmnUtils.isEmpty(prop_val[D_DELIMITER]))CmnUtils.infoPrint("-->Delimiter='" + prop_val[D_DELIMITER] + "'");
314+ if(!CmnUtils.isEmpty(prop_val[D_LINESEP]))CmnUtils.infoPrint("-->LineSeparator='" + prop_val[D_LINESEP] + "'");
315+ if(!CmnUtils.isEmpty(prop_val[D_FILENCODE]))CmnUtils.infoPrint("-->FileEncoding='" + prop_val[D_FILENCODE] + "'");
316+ if(!CmnUtils.isEmpty(prop_val[D_QUOTATION]))CmnUtils.infoPrint("-->Quotation=" + CmnUtils.getYesNo(isQuotation));
317+ if(!CmnUtils.isEmpty(prop_val[D_ORDER]))CmnUtils.infoPrint("-->Sort=" + CmnUtils.getYesNo(isOrder));
337318 if(isInclTables)CmnUtils.infoPrint("-->Include Tables='" + inclTables.toUpperCase() + "'");
338319 if(isExclTables)CmnUtils.infoPrint("-->Exclude Tables='" + exclTables.toUpperCase() + "'");
339320 if(isInclCols)CmnUtils.infoPrint("-->Include Columns='" + inclCols.toUpperCase() + "'");
340321 if(isExclCols)CmnUtils.infoPrint("-->Exclude Columns='" + exclCols.toUpperCase() + "'");
341322 if(isMask){
342323 CmnUtils.infoPrint("-->Masking=" + CmnUtils.getYesNo(isMask));
343- CmnUtils.infoPrint("-->Masking Pattern=" + maskPtn.toUpperCase());
344- if(isInclMaskCols)CmnUtils.infoPrint("-->Masking Columns='" + inclMaskCols.toUpperCase() + "'");
345- if(isExclMaskCols)CmnUtils.infoPrint("-->Exclude Masking Columns='" + exclMaskCols.toUpperCase() + "'");
346- CmnUtils.infoPrint("-->Single Byte Mask Char='" + SingleByteChr + "'");
347- CmnUtils.infoPrint("-->Double Byte Mask Char='" + DoubleByteChr + "'");
324+ CmnUtils.infoPrint("-->Masking Pattern=" + maskPattern.toUpperCase());
325+ if(isInclColsMask)CmnUtils.infoPrint("-->Masking Columns='" + inclMaskCols.toUpperCase() + "'");
326+ if(isExclColsMask)CmnUtils.infoPrint("-->Exclude Masking Columns='" + exclMaskCols.toUpperCase() + "'");
327+ CmnUtils.infoPrint("-->Single Byte Mask Char='" + singleByteMaskChar + "'");
328+ CmnUtils.infoPrint("-->Double Byte Mask Char='" + doubleByteMaskChar + "'");
348329 }
349330 CmnUtils.infoPrint("Start DataUnload ---------------------------------------------");
350331
351- dao.select(sql_table_list);
332+ dao.select(sql_table_key_list);
352333 alData = dao.getArrayList();
353334 tb_count = dao.getColumnCount();
354335 orders = 0;
@@ -357,16 +338,16 @@ public class RapideUnloader{
357338 for(int i=0;i<alData.size();i++){
358339 if ((i+1) % tb_count == 1){
359340 if ((i + 2 <alData.size()) && (!alData.get(i).equals(alData.get(i+2))) || (i + 2 == alData.size())) {
360- if(isInclTables && !CmnUtils.isMatch(aryInclTables,alData.get(i).toUpperCase())){
341+ if(isInclTables && !CmnUtils.isMatch(inclTablesArray,alData.get(i).toUpperCase())){
361342 CmnUtils.debugPrint("inclTables=" + inclTables);
362- CmnUtils.debugPrint("table=" + alData.get(i) + "," +CmnUtils.isMatch(aryInclTables,alData.get(i).toUpperCase()));
343+ CmnUtils.debugPrint("table=" + alData.get(i) + "," +CmnUtils.isMatch(inclTablesArray,alData.get(i).toUpperCase()));
363344 orders = 0;
364345 order_columns = "";
365346 continue;
366347 }
367- if(isExclTables && CmnUtils.isMatch(aryExclTables,alData.get(i).toUpperCase())){
348+ if(isExclTables && CmnUtils.isMatch(exclTablesArray,alData.get(i).toUpperCase())){
368349 CmnUtils.debugPrint("exclTables=" + exclTables);
369- CmnUtils.debugPrint("table=" + alData.get(i) + "," +CmnUtils.isMatch(aryExclTables,alData.get(i).toUpperCase()));
350+ CmnUtils.debugPrint("table=" + alData.get(i) + "," +CmnUtils.isMatch(exclTablesArray,alData.get(i).toUpperCase()));
370351 orders = 0;
371352 order_columns = "";
372353 continue;
@@ -403,18 +384,18 @@ public class RapideUnloader{
403384 if(CmnUtils.isColString(alColTypeName.get(j))){
404385 if(isMask){
405386 if(
406- (isInclMaskCols &&
407- !isExclMaskCols &&
408- CmnUtils.isMatch(aryInclMaskCols,alData.get(i).toUpperCase(),alColName.get(j).toUpperCase())
387+ (isInclColsMask &&
388+ !isExclColsMask &&
389+ CmnUtils.isMatch(inclColsMaskArray,alData.get(i).toUpperCase(),alColName.get(j).toUpperCase())
409390 ) ||
410- (isInclMaskCols &&
411- isExclMaskCols &&
412- CmnUtils.isMatch(aryInclMaskCols,alData.get(i).toUpperCase(),alColName.get(j).toUpperCase()) &&
413- !CmnUtils.isMatch(aryExclMaskCols,alData.get(i).toUpperCase(),alColName.get(j).toUpperCase())
391+ (isInclColsMask &&
392+ isExclColsMask &&
393+ CmnUtils.isMatch(inclColsMaskArray,alData.get(i).toUpperCase(),alColName.get(j).toUpperCase()) &&
394+ !CmnUtils.isMatch(exclColsMaskArray,alData.get(i).toUpperCase(),alColName.get(j).toUpperCase())
414395 ) ||
415- (!isInclMaskCols &&
416- isExclMaskCols &&
417- !CmnUtils.isMatch(aryExclMaskCols,alData.get(i).toUpperCase(),alColName.get(j).toUpperCase())
396+ (!isInclColsMask &&
397+ isExclColsMask &&
398+ !CmnUtils.isMatch(exclColsMaskArray,alData.get(i).toUpperCase(),alColName.get(j).toUpperCase())
418399 )
419400 ){
420401 CmnUtils.debugPrint("Mask Column=" + alColName.get(j).toUpperCase());
@@ -432,16 +413,16 @@ public class RapideUnloader{
432413 if(
433414 (isInclCols &&
434415 !isExclCols &&
435- CmnUtils.isMatch(aryInclCols,alData.get(i).toUpperCase(), alColName.get(j).toUpperCase())
416+ CmnUtils.isMatch(inclColsArray,alData.get(i).toUpperCase(), alColName.get(j).toUpperCase())
436417 ) ||
437418 (isInclCols &&
438419 isExclCols &&
439- CmnUtils.isMatch(aryInclCols,alData.get(i).toUpperCase(), alColName.get(j).toUpperCase()) &&
440- !CmnUtils.isMatch(aryExclCols,alData.get(i).toUpperCase(),alColName.get(j).toUpperCase())
420+ CmnUtils.isMatch(inclColsArray,alData.get(i).toUpperCase(), alColName.get(j).toUpperCase()) &&
421+ !CmnUtils.isMatch(exclColsArray,alData.get(i).toUpperCase(),alColName.get(j).toUpperCase())
441422 ) ||
442423 (!isInclCols &&
443424 isExclCols &&
444- !CmnUtils.isMatch(aryExclCols,alData.get(i).toUpperCase(),alColName.get(j).toUpperCase())
425+ !CmnUtils.isMatch(exclColsArray,alData.get(i).toUpperCase(),alColName.get(j).toUpperCase())
445426 )
446427 ){
447428 CmnUtils.debugPrint("column=" + alColName.get(j).toUpperCase());
@@ -489,29 +470,29 @@ public class RapideUnloader{
489470 }
490471 if (firstCol == lastCol){
491472 if(isQuotation){
492- pw.print("\"" + lnSprtr);
473+ pw.print("\"" + lineSeparator);
493474 } else {
494- pw.print("" + lnSprtr);
475+ pw.print("" + lineSeparator);
495476 }
496477 } else {
497478 if (j==lastCol){
498479 if(isQuotation){
499- pw.print("\"" + lnSprtr);
480+ pw.print("\"" + lineSeparator);
500481 } else {
501- pw.print("" + lnSprtr);
482+ pw.print("" + lineSeparator);
502483 }
503484 } else {
504485 if(colIncl[j]){
505486 if(isQuotation){
506- pw.print("\"" + dlmtr + "\"");
487+ pw.print("\"" + delimiter + "\"");
507488 } else {
508- pw.print(dlmtr);
489+ pw.print(delimiter);
509490 }
510491 }
511492 }
512493 }
513494 }
514- dao.getRecordToPrint(pw,dlmtr,isQuotation,isMask,firstCol,lastCol);
495+ dao.getRecordToPrint(pw,firstCol,lastCol);
515496 dao.closeRecordSet();
516497 pw.close();
517498 pw = null;