OSDN Git Service

20170126
authorkuboryu <kuboryu@yahoo.co.jp>
Wed, 25 Jan 2017 23:28:35 +0000 (08:28 +0900)
committerkuboryu <kuboryu@yahoo.co.jp>
Wed, 25 Jan 2017 23:28:35 +0000 (08:28 +0900)
com/rapide_act/DataAccessObjects.java
com/rapide_act/RapideLoader.java
com/rapide_act/RapideUnloader.java

index 1d84a8f..5897f38 100644 (file)
@@ -73,6 +73,7 @@ public class DataAccessObjects{
        private String tbName = null;
        private String nullMark = "";
        private String lnSprtr = System.getProperty("line.separator");
+       private String delimiter = "\t";
        private char singleByteChr = '*';
        private char doubleByteChr = '\81\96';
        private String maskPtn = "ALT";
@@ -299,6 +300,16 @@ public class DataAccessObjects{
 
        public void setPropVal(String[] _prop_val) throws Exception{
                prop_val = _prop_val;
+               if(!CmnUtils.isEmpty(prop_val[LINESEP]))lnSprtr = CmnUtils.getLineSeparator(prop_val[LINESEP]);
+               if(!CmnUtils.isEmpty(prop_val[NULLMARK]))nullMark = prop_val[NULLMARK];
+               if(!CmnUtils.isEmpty(prop_val[QUOTATION]) && prop_val[QUOTATION].toUpperCase().equals("N"))isQuotation = false;
+               if(!CmnUtils.isEmpty(prop_val[INCLCOLMASK]))isInclMaskCols = true;
+               if(!CmnUtils.isEmpty(prop_val[EXCLCOLMASK]))isExclMaskCols = true;
+               if(isInclMaskCols || isExclMaskCols)isMask = true;
+               if(!CmnUtils.isEmpty(prop_val[SBYTEMASKCHR]))singleByteChr = prop_val[SBYTEMASKCHR].charAt(0);
+               if(!CmnUtils.isEmpty(prop_val[DBYTEMASKCHR]))doubleByteChr = prop_val[DBYTEMASKCHR].charAt(0);
+               if(!CmnUtils.isEmpty(prop_val[MASKPTN]))maskPtn = prop_val[MASKPTN];
+               if(!CmnUtils.isEmpty(prop_val[DELIMITER]))delimiter = CmnUtils.getDelimiter(prop_val[DELIMITER]);
        }
 
        public ResultSet getResultSet() throws Exception{
@@ -329,14 +340,10 @@ public class DataAccessObjects{
                }
        }
        
-       public void getRecordToPrint(PrintWriter _pw, String _splt, boolean _isQuotation, boolean _isMask, int _firstCol, int _lastCol) throws Exception{
+       public void getRecordToPrint(PrintWriter _pw, int _firstCol, int _lastCol) throws Exception{
                try {
                        CmnUtils.debugPrint("Start get Record to Print");
-                       isQuotation = _isQuotation;
-                       isMask = _isMask;
                        recCount = 0;
-                       if(!CmnUtils.isEmpty(prop_val[LINESEP]))lnSprtr = CmnUtils.getLineSeparator(prop_val[LINESEP]);
-                       if(!CmnUtils.isEmpty(prop_val[NULLMARK]))nullMark = prop_val[NULLMARK];
 
                        while (rst.next()) {
                                colString = null;
@@ -362,15 +369,15 @@ public class DataAccessObjects{
                                                                
                                                        } else if (i == _lastCol){
                                                                if(isQuotation){
-                                                                       _pw.print("\"" + _splt + "\"" + colString + "\"" + lnSprtr);
+                                                                       _pw.print("\"" + delimiter + "\"" + colString + "\"" + lnSprtr);
                                                                } else {
-                                                                       _pw.print(_splt + colString + lnSprtr);
+                                                                       _pw.print(delimiter + colString + lnSprtr);
                                                                }
                                                        } else {
                                                                if(isQuotation){
-                                                                       _pw.print("\"" + _splt + "\"" + colString);
+                                                                       _pw.print("\"" + delimiter + "\"" + colString);
                                                                } else {
-                                                                       _pw.print(_splt + colString);
+                                                                       _pw.print(delimiter + colString);
                                                                }
                                                        }
                                                        
@@ -393,15 +400,15 @@ public class DataAccessObjects{
                                                                }
                                                        } else if (i == _lastCol){
                                                                if(isQuotation){
-                                                                       _pw.print("\"" + _splt + "\"" + nullMark + "\"" + lnSprtr);
+                                                                       _pw.print("\"" + delimiter + "\"" + nullMark + "\"" + lnSprtr);
                                                                } else {
-                                                                       _pw.print(_splt + nullMark + lnSprtr);
+                                                                       _pw.print(delimiter + nullMark + lnSprtr);
                                                                }
                                                        } else {
                                                                if(isQuotation){
-                                                                       _pw.print("\"" + _splt + "\"" + nullMark);
+                                                                       _pw.print("\"" + delimiter + "\"" + nullMark);
                                                                } else {
-                                                                       _pw.print(_splt + nullMark);
+                                                                       _pw.print(delimiter + nullMark);
                                                                }
                                                        }
                                                }
@@ -434,13 +441,6 @@ public class DataAccessObjects{
                Clob colClob = null;
                ByteArrayOutputStream baos = null;
                InputStream is = null;
-               if(!CmnUtils.isEmpty(prop_val[QUOTATION]) && prop_val[QUOTATION].toUpperCase().equals("N"))isQuotation = false;
-               if(!CmnUtils.isEmpty(prop_val[INCLCOLMASK]))isInclMaskCols = true;
-               if(!CmnUtils.isEmpty(prop_val[EXCLCOLMASK]))isExclMaskCols = true;
-               if(isInclMaskCols || isExclMaskCols)isMask = true;
-               if(!CmnUtils.isEmpty(prop_val[SBYTEMASKCHR]))singleByteChr = prop_val[SBYTEMASKCHR].charAt(0);
-               if(!CmnUtils.isEmpty(prop_val[DBYTEMASKCHR]))doubleByteChr = prop_val[DBYTEMASKCHR].charAt(0);
-               if(!CmnUtils.isEmpty(prop_val[MASKPTN]))maskPtn = prop_val[MASKPTN];
 
                if (CmnUtils.isColString(_colTypeName)) {
                        colString = _rst.getString(_rec_cnt);
index d2b3094..4185411 100644 (file)
@@ -34,6 +34,7 @@ public class RapideLoader{
        private String url = null;
        private String driver = null;
        private String sql_table_list = null;
+       private String sql_table_key_list = null;
        private static final int DB_TYPE_ORACLE = 0;
        private static final int DB_TYPE_SQLSERVER = 1;
        private static final int DB_TYPE_DB2 = 2;
@@ -44,9 +45,42 @@ public class RapideLoader{
        private static final int MASK_PTN_ALL = 0;
        private static final int MASK_PTN_ALT = 1;
        private static final int MASK_PTN_EDGE = 2;
+       private static final int D_USER = 0;
+       private static final int D_PASS = 1;
+       private static final int D_URL = 2;
+       private static final int D_DRIVER = 3;
+       private static final int D_OUTPUT = 4;
+       private static final int D_INPUT = 5;
+       private static final int D_LINESEP = 6;
+       private static final int D_INLINESEP = 7;
+       private static final int D_FILENCODE = 8;
+       private static final int D_NULLMARK = 9;
+       private static final int D_DELIMITER = 10;
+       private static final int D_TBLSQL = 11;
+       private static final int D_TBLKEYSQL = 12;
+       private static final int D_ORDER = 13;
+       private static final int D_QUOTATION = 14;
+       private static final int D_BATCOUNT = 15;
+       private static final int D_INCLTAB = 16;
+       private static final int D_EXCLTAB = 17;
+       private static final int D_INCLCOL = 18;
+       private static final int D_EXCLCOL = 19;
+       private static final int D_INCLCOLMASK = 20;
+       private static final int D_EXCLCOLMASK = 21;
+       private static final int D_SBYTEMASKCHR = 22;
+       private static final int D_DBYTEMASKCHR = 23;
+       private static final int D_MASKPTN = 24;
+       private static final int D_PROPFILE = 25;
+       private static final int KEYS = 26;
+       private static final String [] PROP_KEY = { "us","pw","url","dr","out","in","ls","ils","fe","nm",
+                                                                                               "dm","ts","tks","od","qt","bc","it","et","ic","ec",
+                                                                                               "icm","ecm","smc","dmc","mp","pf"};
+
+       private String [] prop_val = new String[KEYS];
        private static final String [] MASK_PTN = {"ALL", "ALT", "EDGE"};
-       private String propFile = "RapideLoader.properties";
-       private static String [] arySql_table_list = {
+       private static final String DEFAULT_IN_FOLDER = "input";
+       private static final String DEFAULT_PROP_FILE = "RapideLoader.properties";
+       private static String [] sql_table_list_array = {
                "select "
                + " table_name "
                + " from user_tables "
@@ -57,6 +91,41 @@ public class RapideLoader{
                + " order by name"
        };
 
+       private boolean isLob                                   = false;
+       private boolean isContinue                              = false;
+       private String nullMark                                 = "";
+       private boolean isOrder                                 = false;
+       private boolean isQuotation                     = true;
+       private int batchCount                                  = 1000;
+       private boolean isInclTables                    = false;
+       private boolean isExclTables                    = false;
+       private boolean isInclCols                              = false;
+       private boolean isExclCols                              = false;
+       private boolean isMask                                  = false;
+       private boolean isInclColsMask                  = false;
+       private boolean isExclColsMask                  = false;
+       private String delimiter                                = "\t";
+       private String lineSeparator                    = System.getProperty("line.separator");
+       private String inColLineSeparator               = System.getProperty("line.separator");
+       private String outFolder                                = null;
+       private String inFolder                                 = null;
+       private String inclTables                               = null;
+       private String exclTables                               = null;
+       private String inclCols                                 = null;
+       private String exclCols                                 = null;
+       private String inclColsMask                     = null;
+       private String exclColsMask                     = null;
+       private String [] inclTablesArray               = null;
+       private String [] exclTablesArray               = null;
+       private String [] inclColsArray                         = null;
+       private String [] exclColsArray                         = null;
+       private String [] inclColsMaskArray             = null;
+       private String [] exclColsMaskArray             = null;
+       private char singleByteMaskChar                 = '*';
+       private char doubleByteMaskChar                 = '\u25A0';
+       private String maskPattern                              = "ALT";
+       private String fileEncoding                     = System.getProperty("file.encoding");
+       
        public static void main(String args[]){
                try {
                        if (args.length > 0){
@@ -72,22 +141,17 @@ public class RapideLoader{
        }
 
        private void getProperties(String _propFile) throws Exception{
-               InputStream is = null;
+               BufferedReader br = null;
                Properties prop = null;
                try {
                        prop = new Properties();
-                       is = RapideLoader.class.getClassLoader().getResourceAsStream(_propFile);
-                       prop.load(is);
-                       driver = prop.getProperty(database + "." + "driver");
-                       user = prop.getProperty(database + "." + "user");
-                       pass = prop.getProperty(database + "." + "pass");
-                       url = prop.getProperty(database + "." + "url");
-                       CmnUtils.debugPrint("driver=" + driver);
-                       CmnUtils.debugPrint("user=" + user);
-                       CmnUtils.debugPrint("pass=" + pass);
-                       CmnUtils.debugPrint("url=" + url);
-                       is.close();
-                       is = null;
+                       br = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(_propFile), "UTF-8"));
+                       prop.load(br);
+                       for(int i=0;i<KEYS;i++){
+                               prop_val[i] = prop.getProperty(database + "." +PROP_KEY[i]);
+                       }
+                       br.close();
+                       br = null;
                } catch (NullPointerException e) {
                                throw new Exception("Property File (" + _propFile +") Not Found");
                } catch (IOException e) {
@@ -95,9 +159,9 @@ public class RapideLoader{
                }
                finally{
                        try {
-                               if (is != null) {
-                                       is.close();
-                                       is = null;
+                               if (br != null) {
+                                       br.close();
+                                       br = null;
                                }
                        } 
                        catch (IOException e) {
@@ -106,6 +170,7 @@ public class RapideLoader{
                }               
        }
 
+
        RapideLoader(String _database) throws Exception{
                super();
                database = _database;
@@ -119,6 +184,15 @@ public class RapideLoader{
                String sql_load                                 = null;
                String sql_insert                               = null;
                int dbType                                              = DB_TYPE_UNKNOWN;
+               String strLine                                  = null;
+               String strMltLine                               = null;
+               String tbName                                   = null;
+               String [] flName                                = null;
+               String [] colData                               = null;
+               String [] colName                               = null;
+               String [] colTypeName                   = null;
+               Integer [] isNullable                   = null;
+               Boolean [] colIncl                              = null;
 
                File fldr                                               = null;
                ArrayList<String> alData                = null;
@@ -128,71 +202,64 @@ public class RapideLoader{
                ArrayList<Boolean> alColMask    = null;
                ArrayList<Boolean> alColIncl    = null;
 
-               int batchCount                                  = 1000;
                int tb_count                                    = 0;
                int tb_col_count                                = 0;
                int fl_col_count                                = 0;
 
-               String nullMark                                 = "";
-               String strLine                                  = null;
-               String strMltLine                               = null;
-               String tbName                                   = null;
-               String [] flName                                = null;
-               String [] colData                               = null;
-               String [] colName                               = null;
-               String [] colTypeName                   = null;
-               Integer [] isNullable                   = null;
-               Boolean [] colIncl                              = null;
-               String sprtr                                    = CmnUtils.getSeparator("sprtr", "\t");
-               String lnSprtr                                  = CmnUtils.getLineSeparator("lnSprtr", System.getProperty("line.separator"));
-               String inColLnSprtr                     = CmnUtils.getLineSeparator("inColLnSprtr", System.getProperty("line.separator"));
-               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");
 
-               boolean isLob                                   = false;
-               boolean isContinue                              = false;
-               boolean isQuotation                     = CmnUtils.getSystemProperty("quotation", true);
-               boolean isInclTables                    = CmnUtils.getSystemProperty("inclTables", false);
-               boolean isExclTables                    = CmnUtils.getSystemProperty("exclTables", false);
-               boolean isInclCols                              = CmnUtils.getSystemProperty("inclCols", false);
-               boolean isExclCols                              = CmnUtils.getSystemProperty("exclCols", false);
-               boolean isInclMaskCols                  = CmnUtils.getSystemProperty("inclMaskCols", false);
-               boolean isExclMaskCols                  = CmnUtils.getSystemProperty("exclMaskCols", false);
-               boolean isMask                                  = CmnUtils.getSystemProperty("inclMaskCols", false) || CmnUtils.getSystemProperty("exclMaskCols", false);
-               String defaultFldr                              = "input";
-               String inFldr                                   = System.getProperty("input");
-               char hankakuMask                                = CmnUtils.getSystemProperty("hankakuMask", '*');
-               char zenkakuMask                                = CmnUtils.getSystemProperty("zenkakuMask", '\81\96');
-               String maskPtn                                  = CmnUtils.getSystemProperty("maskPtn", MASK_PTN[MASK_PTN_ALT]);
-               String fileEncoding                     = CmnUtils.getSystemProperty("fileEncoding", System.getProperty("file.encoding"));
 
-               if(System.getProperty("batchCount")!=null){
-                       batchCount = Integer.parseInt(System.getProperty("batchCount"));
-               }
 
                if(database != null){
-                       if(System.getProperty("propFile") != null){
-                               getProperties(System.getProperty("propFile"));
+                       if(!CmnUtils.isEmpty(prop_val[D_PROPFILE])){
+                               getProperties(System.getProperty(prop_val[D_PROPFILE]));
                        } else {
-                               getProperties(propFile);
+                               getProperties(DEFAULT_PROP_FILE);
                        }
-               } else {
-                       user = System.getProperty("user");
-                       pass = System.getProperty("pass");
-                       url = System.getProperty("url");
-                       driver = System.getProperty("driver");
-                       
                }
+               
+               for(int i=0;i<KEYS;i++){
+                       if(System.getProperty(PROP_KEY[i])!=null)prop_val[i] = System.getProperty(PROP_KEY[i]);
+                       CmnUtils.debugPrint(PROP_KEY[i] + "=" + prop_val[i]);
+               }
+               
+               if(!CmnUtils.isEmpty(prop_val[D_USER]))user = prop_val[D_USER];
+               if(!CmnUtils.isEmpty(prop_val[D_PASS]))pass = prop_val[D_PASS];
+               if(!CmnUtils.isEmpty(prop_val[D_URL]))url = prop_val[D_URL];
+               if(!CmnUtils.isEmpty(prop_val[D_DRIVER]))driver = prop_val[D_DRIVER];
+               if(!CmnUtils.isEmpty(prop_val[D_OUTPUT]))outFolder = prop_val[D_OUTPUT];
+               if(!CmnUtils.isEmpty(prop_val[D_INPUT]))inFolder = prop_val[D_INPUT];
+               if(!CmnUtils.isEmpty(prop_val[D_LINESEP]))lineSeparator = CmnUtils.getLineSeparator(prop_val[D_LINESEP]);
+               if(!CmnUtils.isEmpty(prop_val[D_INLINESEP]))inColLineSeparator = CmnUtils.getLineSeparator(prop_val[D_INLINESEP]);
+               if(!CmnUtils.isEmpty(prop_val[D_FILENCODE]))fileEncoding = prop_val[D_FILENCODE];
+               if(!CmnUtils.isEmpty(prop_val[D_NULLMARK]))nullMark = prop_val[D_NULLMARK];
+               if(!CmnUtils.isEmpty(prop_val[D_DELIMITER]))delimiter = CmnUtils.getDelimiter(prop_val[D_DELIMITER]);
+               if(!CmnUtils.isEmpty(prop_val[D_TBLSQL]))sql_table_list = prop_val[D_TBLSQL];
+               if(!CmnUtils.isEmpty(prop_val[D_TBLKEYSQL]))sql_table_key_list = prop_val[D_TBLKEYSQL];
+               if(!CmnUtils.isEmpty(prop_val[D_ORDER]) && prop_val[D_ORDER].toUpperCase().equals("Y"))isOrder = true;
+               if(!CmnUtils.isEmpty(prop_val[D_QUOTATION]) && prop_val[D_QUOTATION].toUpperCase().equals("N"))isQuotation = false;
+               if(!CmnUtils.isEmpty(prop_val[D_BATCOUNT]))batchCount = Integer.parseInt(prop_val[D_BATCOUNT]);
+               if(!CmnUtils.isEmpty(prop_val[D_INCLTAB]))isInclTables = true;
+               if(!CmnUtils.isEmpty(prop_val[D_EXCLTAB]))isExclTables = true;
+               if(!CmnUtils.isEmpty(prop_val[D_INCLCOL]))isInclCols = true;
+               if(!CmnUtils.isEmpty(prop_val[D_EXCLCOL]))isExclCols = true;
+               if(!CmnUtils.isEmpty(prop_val[D_INCLCOLMASK]))isInclColsMask = true;
+               if(!CmnUtils.isEmpty(prop_val[D_EXCLCOLMASK]))isExclColsMask = true;
+               if(isInclColsMask || isExclColsMask)isMask = true;
+               if(!CmnUtils.isEmpty(prop_val[D_INCLTAB]))inclTables = prop_val[D_INCLTAB].toUpperCase();
+               if(!CmnUtils.isEmpty(prop_val[D_EXCLTAB]))exclTables = prop_val[D_EXCLTAB].toUpperCase();
+               if(!CmnUtils.isEmpty(prop_val[D_INCLCOL]))inclCols = prop_val[D_INCLCOL].toUpperCase();
+               if(!CmnUtils.isEmpty(prop_val[D_EXCLCOL]))exclCols = prop_val[D_EXCLCOL].toUpperCase();
+               if(!CmnUtils.isEmpty(prop_val[D_INCLCOLMASK]))inclColsMask = prop_val[D_INCLCOLMASK].toUpperCase();
+               if(!CmnUtils.isEmpty(prop_val[D_EXCLCOLMASK]))exclColsMask = prop_val[D_EXCLCOLMASK].toUpperCase();
+               if(!CmnUtils.isEmpty(prop_val[D_INCLTAB]))inclTablesArray = CmnUtils.splitCsv(prop_val[D_INCLTAB].toUpperCase());
+               if(!CmnUtils.isEmpty(prop_val[D_EXCLTAB]))exclTablesArray = CmnUtils.splitCsv(prop_val[D_EXCLTAB].toUpperCase());
+               if(!CmnUtils.isEmpty(prop_val[D_INCLCOL]))inclColsArray = CmnUtils.splitCsv(prop_val[D_INCLCOL].toUpperCase());
+               if(!CmnUtils.isEmpty(prop_val[D_EXCLCOL]))exclColsArray = CmnUtils.splitCsv(prop_val[D_EXCLCOL].toUpperCase());
+               if(!CmnUtils.isEmpty(prop_val[D_INCLCOLMASK]))inclColsMaskArray = CmnUtils.splitCsv(prop_val[D_INCLCOLMASK].toUpperCase());
+               if(!CmnUtils.isEmpty(prop_val[D_EXCLCOLMASK]))exclColsMaskArray = CmnUtils.splitCsv(prop_val[D_EXCLCOLMASK].toUpperCase());
+               if(!CmnUtils.isEmpty(prop_val[D_SBYTEMASKCHR]))singleByteMaskChar = prop_val[D_SBYTEMASKCHR].charAt(0);
+               if(!CmnUtils.isEmpty(prop_val[D_DBYTEMASKCHR]))doubleByteMaskChar = prop_val[D_DBYTEMASKCHR].charAt(0);
+               if(!CmnUtils.isEmpty(prop_val[D_MASKPTN]))maskPattern = prop_val[D_MASKPTN];
 
                if(user == null){
                        throw new Exception("user is null");
@@ -212,10 +279,10 @@ public class RapideLoader{
                }
                
                if (dbType != DB_TYPE_UNKNOWN){
-                       if(System.getProperty("sql_table_list") != null){
-                               sql_table_list = System.getProperty("sql_table_list");
+                       if(!CmnUtils.isEmpty(prop_val[D_TBLSQL])){
+                               sql_table_list = prop_val[D_TBLSQL];
                        } else {
-                               sql_table_list = arySql_table_list[dbType];
+                               sql_table_list = sql_table_list_array[dbType];
                        }
                } else {
                        throw new Exception("dbtype unknown");
@@ -226,18 +293,18 @@ public class RapideLoader{
                        conn = dao.connect();
                        conn.setAutoCommit(false);
 
-                       if(inFldr != null){
-                               fldr = new File(inFldr);
+                       if(inFolder != null){
+                               fldr = new File(inFolder);
                        } else {
                                if (database != null){
-                                       fldr = new File(defaultFldr + "/" + database.toUpperCase());
+                                       fldr = new File(DEFAULT_IN_FOLDER + "/" + database.toUpperCase());
                                } else {
-                                       fldr = new File(defaultFldr + "/" + DB_TYPE_NAME[dbType].toUpperCase());
+                                       fldr = new File(DEFAULT_IN_FOLDER + "/" + DB_TYPE_NAME[dbType].toUpperCase());
                                }
                        }
                        CmnUtils.infoPrint("-->\91Î\8fÛ\83f\81[\83^\83x\81[\83X='" + database.toUpperCase() + "'");
                        CmnUtils.infoPrint("-->\93ü\97Í\8c³='" + fldr + "'");
-                       CmnUtils.infoPrint("-->\8bæ\90Ø\82è\95\8e\9a='" + sprtr + "'");
+                       CmnUtils.infoPrint("-->\8bæ\90Ø\82è\95\8e\9a='" + delimiter + "'");
                        CmnUtils.infoPrint("-->\83o\83b\83`\83J\83E\83\93\83g=" + batchCount);
                        CmnUtils.infoPrint("-->\88ø\97p\8bå=" + CmnUtils.getYesNo(isQuotation));
                        if(isInclTables)CmnUtils.infoPrint("-->\91Î\8fÛ\83e\81[\83u\83\8b='" + inclTables.toUpperCase() + "'");
@@ -246,11 +313,11 @@ public class RapideLoader{
                        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(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("-->\83}\83X\83N\83L\83\93\83O\83p\83^\81[\83\93=" + maskPattern.toUpperCase());
+                               if(isInclColsMask)CmnUtils.infoPrint("-->\83}\83X\83N\91Î\8fÛ\83J\83\89\83\80='" + inclColsMask.toUpperCase() + "'");
+                               if(isExclColsMask)CmnUtils.infoPrint("-->\83}\83X\83N\8f\9c\8aO\83J\83\89\83\80='" + exclColsMask.toUpperCase() + "'");
+                               CmnUtils.infoPrint("-->\94¼\8ap\83}\83X\83N\95\8e\9a='" + singleByteMaskChar + "'");
+                               CmnUtils.infoPrint("-->\91S\8ap\83}\83X\83N\95\8e\9a='" + doubleByteMaskChar + "'");
                        }
                        CmnUtils.infoPrint("\83f\81[\83^\83\8d\81[\83h\82ð\8aJ\8en\82µ\82Ü\82µ\82½\81B");
 
@@ -270,14 +337,14 @@ public class RapideLoader{
                                        TABLE_LOOP:
                                        for(int i=0;i<alData.size();i++){
                                                if(tbName.equals(alData.get(i))){
-                                                       if(isInclTables && !CmnUtils.isMatch(aryInclTables,tbName.toUpperCase())){
+                                                       if(isInclTables && !CmnUtils.isMatch(inclTablesArray,tbName.toUpperCase())){
                                                                CmnUtils.debugPrint("inclTables=" + inclTables);
-                                                               CmnUtils.debugPrint("table=" + tbName + "," +CmnUtils.isMatch(aryInclTables,tbName.toUpperCase()));
+                                                               CmnUtils.debugPrint("table=" + tbName + "," +CmnUtils.isMatch(inclTablesArray,tbName.toUpperCase()));
                                                                continue;
                                                        }
-                                                       if(isExclTables && CmnUtils.isMatch(aryExclTables,tbName.toUpperCase())){
+                                                       if(isExclTables && CmnUtils.isMatch(exclTablesArray,tbName.toUpperCase())){
                                                                CmnUtils.debugPrint("exclTables=" + exclTables);
-                                                               CmnUtils.debugPrint("table=" + tbName + "," +CmnUtils.isMatch(aryExclTables,tbName.toUpperCase()));
+                                                               CmnUtils.debugPrint("table=" + tbName + "," +CmnUtils.isMatch(exclTablesArray,tbName.toUpperCase()));
                                                                continue;
                                                        }
                                                        br = new BufferedReader(new InputStreamReader(new FileInputStream(fldr + "/" + alData.get(i) + "." + flName[1]), fileEncoding));
@@ -309,9 +376,9 @@ public class RapideLoader{
                                                        while((strLine=br.readLine()) != null){
                                                                if (fl_rec_count == 0){
                                                                        if(isQuotation){
-                                                                               colData = CmnUtils.split(strLine,"\"" + sprtr + "\"");
+                                                                               colData = CmnUtils.split(strLine,"\"" + delimiter + "\"");
                                                                        } else {
-                                                                               colData = CmnUtils.split(strLine,sprtr);
+                                                                               colData = CmnUtils.split(strLine,delimiter);
                                                                        }
                                                                        fl_col_count = colData.length;
                                                                        fl_col_seq = new int[colData.length];
@@ -324,16 +391,16 @@ public class RapideLoader{
                                                                                                        if(
                                                                                                                (isInclCols && 
                                                                                                                 !isExclCols &&
-                                                                                                                CmnUtils.isMatch(aryInclCols, tbName.toUpperCase(), colName[l].toUpperCase())
+                                                                                                                CmnUtils.isMatch(inclColsArray, tbName.toUpperCase(), colName[l].toUpperCase())
                                                                                                                ) ||
                                                                                                                (isInclCols && 
                                                                                                                 isExclCols &&
-                                                                                                                CmnUtils.isMatch(aryInclCols, tbName.toUpperCase(), colName[l].toUpperCase()) &&
-                                                                                                                !CmnUtils.isMatch(aryExclCols, tbName.toUpperCase(), colName[l].toUpperCase())
+                                                                                                                CmnUtils.isMatch(inclColsArray, tbName.toUpperCase(), colName[l].toUpperCase()) &&
+                                                                                                                !CmnUtils.isMatch(exclColsArray, tbName.toUpperCase(), colName[l].toUpperCase())
                                                                                                                ) ||
                                                                                                                (!isInclCols && 
                                                                                                                 isExclCols &&
-                                                                                                                !CmnUtils.isMatch(aryExclCols, tbName.toUpperCase(), colName[l].toUpperCase())
+                                                                                                                !CmnUtils.isMatch(exclColsArray, tbName.toUpperCase(), colName[l].toUpperCase())
                                                                                                                )
                                                                                                        ){
                                                                                                                CmnUtils.debugPrint("\91Î\8fÛ\83J\83\89\83\80=" + colName[l].toUpperCase());
@@ -398,9 +465,9 @@ public class RapideLoader{
                                                                        }
                                                                } else {
                                                                        if(isQuotation){
-                                                                               colData = CmnUtils.split(strLine,"\"" + sprtr + "\"");
+                                                                               colData = CmnUtils.split(strLine,"\"" + delimiter + "\"");
                                                                        } else {
-                                                                               colData = CmnUtils.split(strLine,sprtr);
+                                                                               colData = CmnUtils.split(strLine,delimiter);
                                                                        }
                                                                        if(colData.length == fl_col_count){
                                                                                if(!strMltLine.equals("")){
@@ -424,11 +491,11 @@ public class RapideLoader{
                                                                                        strMltLine += strLine;
                                                                                        isContinue = true;
                                                                                } else {
-                                                                                       strMltLine += inColLnSprtr + strLine;
+                                                                                       strMltLine += inColLineSeparator + strLine;
                                                                                        if(isQuotation){
-                                                                                               colData = CmnUtils.split(strMltLine,"\"" + sprtr + "\"");
+                                                                                               colData = CmnUtils.split(strMltLine,"\"" + delimiter + "\"");
                                                                                        } else {
-                                                                                               colData = CmnUtils.split(strMltLine,sprtr);
+                                                                                               colData = CmnUtils.split(strMltLine,delimiter);
                                                                                        }
                                                                                        if(colData.length == fl_col_count){
                                                                                                isContinue = false;
@@ -465,33 +532,33 @@ public class RapideLoader{
                                                                                        if (CmnUtils.isColString(colTypeName[tb_col_seq[j]])){
                                                                                                if(isMask){
                                                                                                        if(
-                                                                                                               (isInclMaskCols &&
-                                                                                                                !isExclMaskCols && 
-                                                                                                                CmnUtils.isMatch(aryInclMaskCols,tbName.toUpperCase(), colName[tb_col_seq[j]].toUpperCase())
+                                                                                                               (isInclColsMask &&
+                                                                                                                !isExclColsMask && 
+                                                                                                                CmnUtils.isMatch(inclColsMaskArray,tbName.toUpperCase(), colName[tb_col_seq[j]].toUpperCase())
                                                                                                                ) ||
-                                                                                                               (isInclMaskCols &&
-                                                                                                                isExclMaskCols && 
-                                                                                                                CmnUtils.isMatch(aryInclMaskCols,tbName.toUpperCase(), colName[tb_col_seq[j]].toUpperCase()) &&
-                                                                                                                !CmnUtils.isMatch(aryExclMaskCols,tbName.toUpperCase(),colName[tb_col_seq[j]].toUpperCase())
+                                                                                                               (isInclColsMask &&
+                                                                                                                isExclColsMask && 
+                                                                                                                CmnUtils.isMatch(inclColsMaskArray,tbName.toUpperCase(), colName[tb_col_seq[j]].toUpperCase()) &&
+                                                                                                                !CmnUtils.isMatch(exclColsMaskArray,tbName.toUpperCase(),colName[tb_col_seq[j]].toUpperCase())
                                                                                                                ) ||
-                                                                                                               (!isInclMaskCols &&
-                                                                                                                isExclMaskCols && 
-                                                                                                                !CmnUtils.isMatch(aryExclMaskCols,tbName.toUpperCase(),colName[tb_col_seq[j]].toUpperCase())
+                                                                                                               (!isInclColsMask &&
+                                                                                                                isExclColsMask && 
+                                                                                                                !CmnUtils.isMatch(exclColsMaskArray,tbName.toUpperCase(),colName[tb_col_seq[j]].toUpperCase())
                                                                                                                )
                                                                                                        ){
                                                                                                                StringBuffer sb = new StringBuffer();
                                                                                                                for(int l=0;l<colData[fl_col_seq[j]].length();l++){
-                                                                                                                       if((maskPtn.toUpperCase().equals(MASK_PTN[MASK_PTN_ALT]) && 
+                                                                                                                       if((maskPattern.toUpperCase().equals(MASK_PTN[MASK_PTN_ALT]) && 
                                                                                                                                        (l % 2) == 1) || 
-                                                                                                                          (maskPtn.toUpperCase().equals(MASK_PTN[MASK_PTN_EDGE]) && 
+                                                                                                                          (maskPattern.toUpperCase().equals(MASK_PTN[MASK_PTN_EDGE]) && 
                                                                                                                                        !(l == 0 || j == colData[fl_col_seq[j]].length() - 1) ||
-                                                                                                                          (maskPtn.toUpperCase().equals(MASK_PTN[MASK_PTN_ALL]))
+                                                                                                                          (maskPattern.toUpperCase().equals(MASK_PTN[MASK_PTN_ALL]))
                                                                                                                           )
                                                                                                                        ){
                                                                                                                                if(CmnUtils.isHankaku(colData[fl_col_seq[j]].charAt(l))){
-                                                                                                                                       sb.append(hankakuMask);
+                                                                                                                                       sb.append(singleByteMaskChar);
                                                                                                                                } else {
-                                                                                                                                       sb.append(zenkakuMask);
+                                                                                                                                       sb.append(doubleByteMaskChar);
                                                                                                                                }
                                                                                                                        } else {
                                                                                                                                sb.append(colData[fl_col_seq[j]].charAt(l));
index 8df50ac..a41642c 100644 (file)
@@ -34,78 +34,87 @@ public class RapideUnloader{
        private String user = null;
        private String pass = null;
        private String url = null;
-       private String sql_table_list;
+       private String sql_table_key_list;
        private static final int DB_TYPE_ORACLE = 0;
        private static final int DB_TYPE_SQLSERVER = 1;
        private static final int DB_TYPE_DB2 = 2;
        private static final int DB_TYPE_MYSQL = 3;
        private static final int DB_TYPE_POSTGRESQL = 4;
        private static final int DB_TYPE_UNKNOWN = -1;
-       private static final String [] DB_TYPE_NAME = {"ORACLE", "SQLSERVER", "DB2", "MYSQL", "POSTGRESQL"};
        private static final int MASK_PTN_ALL = 0;
        private static final int MASK_PTN_ALT = 1;
        private static final int MASK_PTN_EDGE = 2;
-       private static final String [] MASK_PTN = {"ALL", "ALT", "EDGE"};
-       private static final int USER = 0;
-       private static final int PASS = 1;
-       private static final int URL = 2;
-       private static final int DRIVER = 3;
-       private static final int OUTPUT = 4;
-       private static final int INPUT = 5;
-       private static final int LINESEP = 6;
-       private static final int INLINESEP = 7;
-       private static final int FILENCODE = 8;
-       private static final int NULLMARK = 9;
-       private static final int DELIMITER = 10;
-       private static final int TBLSQL = 11;
-       private static final int TBLKEYSQL = 12;
-       private static final int ORDER = 13;
-       private static final int QUOTATION = 14;
-       private static final int BATCOUNT = 15;
-       private static final int INCLTAB = 16;
-       private static final int EXCLTAB = 17;
-       private static final int INCLCOL = 18;
-       private static final int EXCLCOL = 19;
-       private static final int INCLCOLMASK = 20;
-       private static final int EXCLCOLMASK = 21;
-       private static final int SBYTEMASKCHR = 22;
-       private static final int DBYTEMASKCHR = 23;
-       private static final int MASKPTN = 24;
-       private static final int PROPFILE = 25;
-       private static final String [] PROP_KEY = { 
-                                                                                               "us",
-                                                                                               "pw",
-                                                                                               "url",
-                                                                                               "dr",
-                                                                                               "out",
-                                                                                               "in",
-                                                                                               "ls",
-                                                                                               "ils",
-                                                                                               "fe",
-                                                                                               "nm",
-                                                                                               "dm",
-                                                                                               "ts",
-                                                                                               "tks",
-                                                                                               "od",
-                                                                                               "qt",
-                                                                                               "bc",
-                                                                                               "it",
-                                                                                               "et",
-                                                                                               "ic",
-                                                                                               "ec",
-                                                                                               "icm",
-                                                                                               "ecm",
-                                                                                               "smc",
-                                                                                               "dmc",
-                                                                                               "mp",
-                                                                                               "pf"
-                                                                                       };
+       private static final int D_USER = 0;
+       private static final int D_PASS = 1;
+       private static final int D_URL = 2;
+       private static final int D_DRIVER = 3;
+       private static final int D_OUTPUT = 4;
+       private static final int D_INPUT = 5;
+       private static final int D_LINESEP = 6;
+       private static final int D_INLINESEP = 7;
+       private static final int D_FILENCODE = 8;
+       private static final int D_NULLMARK = 9;
+       private static final int D_DELIMITER = 10;
+       private static final int D_TBLSQL = 11;
+       private static final int D_TBLKEYSQL = 12;
+       private static final int D_ORDER = 13;
+       private static final int D_QUOTATION = 14;
+       private static final int D_BATCOUNT = 15;
+       private static final int D_INCLTAB = 16;
+       private static final int D_EXCLTAB = 17;
+       private static final int D_INCLCOL = 18;
+       private static final int D_EXCLCOL = 19;
+       private static final int D_INCLCOLMASK = 20;
+       private static final int D_EXCLCOLMASK = 21;
+       private static final int D_SBYTEMASKCHR = 22;
+       private static final int D_DBYTEMASKCHR = 23;
+       private static final int D_MASKPTN = 24;
+       private static final int D_PROPFILE = 25;
        private static final int KEYS = 26;
+       private static final String [] DB_TYPE_NAME = {"ORACLE", "SQLSERVER", "DB2", "MYSQL", "POSTGRESQL"};
+       private static final String [] MASK_PTN = {"ALL", "ALT", "EDGE"};
+       private static final String [] PROP_KEY = { "us","pw","url","dr","out","in","ls","ils","fe","nm",
+                                                                                               "dm","ts","tks","od","qt","bc","it","et","ic","ec",
+                                                                                               "icm","ecm","smc","dmc","mp","pf"};
+       private static final String DEFAULT_FOLDER              = "output";
+       private static final String DEFAULT_PROP_FILE   = "RapideLoader.properties";
+
+       private String nullMark                                 = "";
+       private boolean isOrder                                 = false;
+       private boolean isQuotation                     = true;
+       private boolean isInclTables                    = false;
+       private boolean isExclTables                    = false;
+       private boolean isInclCols                              = false;
+       private boolean isExclCols                              = false;
+       private boolean isMask                                  = false;
+       private boolean isInclColsMask                  = false;
+       private boolean isExclColsMask                  = false;
+       private String delimiter                                = "\t";
+       private String lineSeparator                    = System.getProperty("line.separator");
+       private String inColLineSeparator               = System.getProperty("line.separator");
+       private String outFolder                                = null;
+       private String inFolder                                 = null;
+       private String inclTables                               = null;
+       private String exclTables                               = null;
+       private String inclCols                                 = null;
+       private String exclCols                                 = null;
+       private String inclMaskCols                     = null;
+       private String exclMaskCols                     = null;
+       private String [] inclTablesArray               = null;
+       private String [] exclTablesArray               = null;
+       private String [] inclColsArray                         = null;
+       private String [] exclColsArray                         = null;
+       private String [] inclColsMaskArray             = null;
+       private String [] exclColsMaskArray             = null;
+       private char singleByteMaskChar                 = '*';
+       private char doubleByteMaskChar                 = '\u25A0';
+       private String maskPattern                              = "ALT";
+       private String fileEncoding                     = System.getProperty("file.encoding");
+       
        private String [] prop_val = new String[KEYS];
        
-       private String propFile = "RapideLoader.properties";
 
-       private static String [] arySql_table_list = {
+       private static String [] sql_table_key_list_array = {
                "select "
                + "a.table_name,"
                + "d.column_name "
@@ -162,7 +171,7 @@ public class RapideUnloader{
                Properties prop = null;
                try {
                        prop = new Properties();
-                       br = new BufferedReader(new InputStreamReader(new FileInputStream(_propFile), "UTF-8"));
+                       br = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(_propFile), "UTF-8"));
                        prop.load(br);
                        for(int i=0;i<KEYS;i++){
                                prop_val[i] = prop.getProperty(database + "." +PROP_KEY[i]);
@@ -208,41 +217,13 @@ public class RapideUnloader{
                int tb_count                                    = 0;
                int tb_col_count                                = 0;
 
-               boolean isOrder                                 = false;
-               boolean isQuotation                     = true;
-               boolean isInclTables                    = false;
-               boolean isExclTables                    = false;
-               boolean isInclCols                              = false;
-               boolean isExclCols                              = false;
-               boolean isMask                                  = false;
-               boolean isInclMaskCols                  = false;
-               boolean isExclMaskCols                  = false;
-               String dlmtr                                    = "\t";
-               String lnSprtr                                  = System.getProperty("line.separator");
-               String defaultFldr                              = "output";
-               String outFldr                                  = null;
-               String inclTables                               = null;
-               String exclTables                               = null;
-               String inclCols                                 = null;
-               String exclCols                                 = null;
-               String inclMaskCols                     = null;
-               String exclMaskCols                     = null;
-               String [] aryInclTables                 = null;
-               String [] aryExclTables                 = null;
-               String [] aryInclMaskCols               = null;
-               String [] aryExclMaskCols               = null;
-               String [] aryInclCols                   = null;
-               String [] aryExclCols                   = null;
-               char SingleByteChr                              = '*';
-               char DoubleByteChr                              = '\81\96';
-               String maskPtn                                  = "ALT";
-               String fileEncoding                     = System.getProperty("file.encoding");
+
 
                if(database != null){
-                       if(System.getProperty("pf") != null){
-                               getProperties(System.getProperty("pf"));
+                       if(!CmnUtils.isEmpty(prop_val[D_PROPFILE])){
+                               getProperties(System.getProperty(prop_val[D_PROPFILE]));
                        } else {
-                               getProperties(propFile);
+                               getProperties(DEFAULT_PROP_FILE);
                        }
                }
                
@@ -251,38 +232,38 @@ public class RapideUnloader{
                        CmnUtils.debugPrint(PROP_KEY[i] + "=" + prop_val[i]);
                }
                
-               if(!CmnUtils.isEmpty(prop_val[USER]))user = prop_val[USER];
-               if(!CmnUtils.isEmpty(prop_val[PASS]))pass = prop_val[PASS];
-               if(!CmnUtils.isEmpty(prop_val[URL]))url = prop_val[URL];
-               if(!CmnUtils.isEmpty(prop_val[DRIVER]))driver = prop_val[DRIVER];
-               if(!CmnUtils.isEmpty(prop_val[ORDER]) && prop_val[ORDER].toUpperCase().equals("Y"))isOrder = true;
-               if(!CmnUtils.isEmpty(prop_val[QUOTATION]) && prop_val[QUOTATION].toUpperCase().equals("N"))isQuotation = false;
-               if(!CmnUtils.isEmpty(prop_val[INCLTAB]))isInclTables = true;
-               if(!CmnUtils.isEmpty(prop_val[EXCLTAB]))isExclTables = true;
-               if(!CmnUtils.isEmpty(prop_val[INCLCOL]))isInclCols = true;
-               if(!CmnUtils.isEmpty(prop_val[EXCLCOL]))isExclCols = true;
-               if(!CmnUtils.isEmpty(prop_val[INCLCOLMASK]))isInclMaskCols = true;
-               if(!CmnUtils.isEmpty(prop_val[EXCLCOLMASK]))isExclMaskCols = true;
-               if(isInclMaskCols || isExclMaskCols)isMask = true;
-               if(!CmnUtils.isEmpty(prop_val[DELIMITER]))dlmtr = CmnUtils.getDelimiter(prop_val[DELIMITER]);
-               if(!CmnUtils.isEmpty(prop_val[LINESEP]))lnSprtr = CmnUtils.getLineSeparator(prop_val[LINESEP]);
-               if(!CmnUtils.isEmpty(prop_val[OUTPUT]))outFldr = prop_val[OUTPUT];
-               if(!CmnUtils.isEmpty(prop_val[INCLTAB]))inclTables = prop_val[INCLTAB].toUpperCase();
-               if(!CmnUtils.isEmpty(prop_val[EXCLTAB]))exclTables = prop_val[EXCLTAB].toUpperCase();
-               if(!CmnUtils.isEmpty(prop_val[INCLCOL]))inclCols = prop_val[INCLCOL].toUpperCase();
-               if(!CmnUtils.isEmpty(prop_val[EXCLCOL]))exclCols = prop_val[EXCLCOL].toUpperCase();
-               if(!CmnUtils.isEmpty(prop_val[INCLCOLMASK]))inclMaskCols = prop_val[INCLCOLMASK].toUpperCase();
-               if(!CmnUtils.isEmpty(prop_val[EXCLCOLMASK]))exclMaskCols = prop_val[EXCLCOLMASK].toUpperCase();
-               if(!CmnUtils.isEmpty(prop_val[INCLTAB]))aryInclTables = CmnUtils.splitCsv(prop_val[INCLTAB].toUpperCase());
-               if(!CmnUtils.isEmpty(prop_val[EXCLTAB]))aryExclTables = CmnUtils.splitCsv(prop_val[EXCLTAB].toUpperCase());
-               if(!CmnUtils.isEmpty(prop_val[INCLCOL]))aryInclCols = CmnUtils.splitCsv(prop_val[INCLCOL].toUpperCase());
-               if(!CmnUtils.isEmpty(prop_val[EXCLCOL]))aryExclCols = CmnUtils.splitCsv(prop_val[EXCLCOL].toUpperCase());
-               if(!CmnUtils.isEmpty(prop_val[INCLCOLMASK]))aryInclMaskCols = CmnUtils.splitCsv(prop_val[INCLCOLMASK].toUpperCase());
-               if(!CmnUtils.isEmpty(prop_val[EXCLCOLMASK]))aryExclMaskCols = CmnUtils.splitCsv(prop_val[EXCLCOLMASK].toUpperCase());
-               if(!CmnUtils.isEmpty(prop_val[SBYTEMASKCHR]))SingleByteChr = prop_val[SBYTEMASKCHR].charAt(0);
-               if(!CmnUtils.isEmpty(prop_val[DBYTEMASKCHR]))DoubleByteChr = prop_val[DBYTEMASKCHR].charAt(0);
-               if(!CmnUtils.isEmpty(prop_val[MASKPTN]))maskPtn = prop_val[MASKPTN];
-               if(!CmnUtils.isEmpty(prop_val[FILENCODE]))fileEncoding = prop_val[FILENCODE];
+               if(!CmnUtils.isEmpty(prop_val[D_USER]))user = prop_val[D_USER];
+               if(!CmnUtils.isEmpty(prop_val[D_PASS]))pass = prop_val[D_PASS];
+               if(!CmnUtils.isEmpty(prop_val[D_URL]))url = prop_val[D_URL];
+               if(!CmnUtils.isEmpty(prop_val[D_DRIVER]))driver = prop_val[D_DRIVER];
+               if(!CmnUtils.isEmpty(prop_val[D_ORDER]) && prop_val[D_ORDER].toUpperCase().equals("Y"))isOrder = true;
+               if(!CmnUtils.isEmpty(prop_val[D_QUOTATION]) && prop_val[D_QUOTATION].toUpperCase().equals("N"))isQuotation = false;
+               if(!CmnUtils.isEmpty(prop_val[D_INCLTAB]))isInclTables = true;
+               if(!CmnUtils.isEmpty(prop_val[D_EXCLTAB]))isExclTables = true;
+               if(!CmnUtils.isEmpty(prop_val[D_INCLCOL]))isInclCols = true;
+               if(!CmnUtils.isEmpty(prop_val[D_EXCLCOL]))isExclCols = true;
+               if(!CmnUtils.isEmpty(prop_val[D_INCLCOLMASK]))isInclColsMask = true;
+               if(!CmnUtils.isEmpty(prop_val[D_EXCLCOLMASK]))isExclColsMask = true;
+               if(isInclColsMask || isExclColsMask)isMask = true;
+               if(!CmnUtils.isEmpty(prop_val[D_DELIMITER]))delimiter = CmnUtils.getDelimiter(prop_val[D_DELIMITER]);
+               if(!CmnUtils.isEmpty(prop_val[D_LINESEP]))lineSeparator = CmnUtils.getLineSeparator(prop_val[D_LINESEP]);
+               if(!CmnUtils.isEmpty(prop_val[D_OUTPUT]))outFolder = prop_val[D_OUTPUT];
+               if(!CmnUtils.isEmpty(prop_val[D_INCLTAB]))inclTables = prop_val[D_INCLTAB].toUpperCase();
+               if(!CmnUtils.isEmpty(prop_val[D_EXCLTAB]))exclTables = prop_val[D_EXCLTAB].toUpperCase();
+               if(!CmnUtils.isEmpty(prop_val[D_INCLCOL]))inclCols = prop_val[D_INCLCOL].toUpperCase();
+               if(!CmnUtils.isEmpty(prop_val[D_EXCLCOL]))exclCols = prop_val[D_EXCLCOL].toUpperCase();
+               if(!CmnUtils.isEmpty(prop_val[D_INCLCOLMASK]))inclMaskCols = prop_val[D_INCLCOLMASK].toUpperCase();
+               if(!CmnUtils.isEmpty(prop_val[D_EXCLCOLMASK]))exclMaskCols = prop_val[D_EXCLCOLMASK].toUpperCase();
+               if(!CmnUtils.isEmpty(prop_val[D_INCLTAB]))inclTablesArray = CmnUtils.splitCsv(prop_val[D_INCLTAB].toUpperCase());
+               if(!CmnUtils.isEmpty(prop_val[D_EXCLTAB]))exclTablesArray = CmnUtils.splitCsv(prop_val[D_EXCLTAB].toUpperCase());
+               if(!CmnUtils.isEmpty(prop_val[D_INCLCOL]))inclColsArray = CmnUtils.splitCsv(prop_val[D_INCLCOL].toUpperCase());
+               if(!CmnUtils.isEmpty(prop_val[D_EXCLCOL]))exclColsArray = CmnUtils.splitCsv(prop_val[D_EXCLCOL].toUpperCase());
+               if(!CmnUtils.isEmpty(prop_val[D_INCLCOLMASK]))inclColsMaskArray = CmnUtils.splitCsv(prop_val[D_INCLCOLMASK].toUpperCase());
+               if(!CmnUtils.isEmpty(prop_val[D_EXCLCOLMASK]))exclColsMaskArray = CmnUtils.splitCsv(prop_val[D_EXCLCOLMASK].toUpperCase());
+               if(!CmnUtils.isEmpty(prop_val[D_SBYTEMASKCHR]))singleByteMaskChar = prop_val[D_SBYTEMASKCHR].charAt(0);
+               if(!CmnUtils.isEmpty(prop_val[D_DBYTEMASKCHR]))doubleByteMaskChar = prop_val[D_DBYTEMASKCHR].charAt(0);
+               if(!CmnUtils.isEmpty(prop_val[D_MASKPTN]))maskPattern = prop_val[D_MASKPTN];
+               if(!CmnUtils.isEmpty(prop_val[D_FILENCODE]))fileEncoding = prop_val[D_FILENCODE];
 
                if(user == null){
                        throw new Exception("user is null");
@@ -302,10 +283,10 @@ public class RapideUnloader{
                }
                
                if (dbType != DB_TYPE_UNKNOWN){
-                       if(!CmnUtils.isEmpty(prop_val[TBLKEYSQL])){
-                               sql_table_list = prop_val[TBLKEYSQL];
+                       if(!CmnUtils.isEmpty(prop_val[D_TBLKEYSQL])){
+                               sql_table_key_list = prop_val[D_TBLKEYSQL];
                        } else {
-                               sql_table_list = arySql_table_list[dbType];
+                               sql_table_key_list = sql_table_key_list_array[dbType];
                        }
                } else {
                        throw new Exception("dbtype unknown");
@@ -316,39 +297,39 @@ public class RapideUnloader{
                try {
                        conn = dao.connect();
                        
-                       if(outFldr != null){
-                               fldr = new File(outFldr);
+                       if(outFolder != null){
+                               fldr = new File(outFolder);
                        } else {
                                if(database != null){
-                                       fldr = new File(defaultFldr + "/" + database.toUpperCase() + "_" + CmnUtils.getYmdhm());
+                                       fldr = new File(DEFAULT_FOLDER + "/" + database.toUpperCase() + "_" + CmnUtils.getYmdhm());
                                } else {
-                                       fldr = new File(defaultFldr + "/" + DB_TYPE_NAME[dbType].toUpperCase() + "_" + CmnUtils.getYmdhm());
+                                       fldr = new File(DEFAULT_FOLDER + "/" + DB_TYPE_NAME[dbType].toUpperCase() + "_" + CmnUtils.getYmdhm());
                                }
                                fldr.mkdir();
                        }
                        
                        if(database!=null)CmnUtils.infoPrint("-->Database='" + database.toUpperCase() + "'");
                        CmnUtils.infoPrint("-->Output='" + fldr + "'");
-                       if(!CmnUtils.isEmpty(prop_val[DELIMITER]))CmnUtils.infoPrint("-->Delimiter='" + prop_val[DELIMITER] + "'");
-                       if(!CmnUtils.isEmpty(prop_val[LINESEP]))CmnUtils.infoPrint("-->LineSeparator='" + prop_val[LINESEP] + "'");
-                       if(!CmnUtils.isEmpty(prop_val[FILENCODE]))CmnUtils.infoPrint("-->FileEncoding='" + prop_val[FILENCODE] + "'");
-                       if(!CmnUtils.isEmpty(prop_val[QUOTATION]))CmnUtils.infoPrint("-->Quotation=" + CmnUtils.getYesNo(isQuotation));
-                       if(!CmnUtils.isEmpty(prop_val[ORDER]))CmnUtils.infoPrint("-->Sort=" + CmnUtils.getYesNo(isOrder));
+                       if(!CmnUtils.isEmpty(prop_val[D_DELIMITER]))CmnUtils.infoPrint("-->Delimiter='" + prop_val[D_DELIMITER] + "'");
+                       if(!CmnUtils.isEmpty(prop_val[D_LINESEP]))CmnUtils.infoPrint("-->LineSeparator='" + prop_val[D_LINESEP] + "'");
+                       if(!CmnUtils.isEmpty(prop_val[D_FILENCODE]))CmnUtils.infoPrint("-->FileEncoding='" + prop_val[D_FILENCODE] + "'");
+                       if(!CmnUtils.isEmpty(prop_val[D_QUOTATION]))CmnUtils.infoPrint("-->Quotation=" + CmnUtils.getYesNo(isQuotation));
+                       if(!CmnUtils.isEmpty(prop_val[D_ORDER]))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("-->Masking=" + CmnUtils.getYesNo(isMask));
-                               CmnUtils.infoPrint("-->Masking Pattern=" + maskPtn.toUpperCase());
-                               if(isInclMaskCols)CmnUtils.infoPrint("-->Masking Columns='" + inclMaskCols.toUpperCase() + "'");
-                               if(isExclMaskCols)CmnUtils.infoPrint("-->Exclude Masking Columns='" + exclMaskCols.toUpperCase() + "'");
-                               CmnUtils.infoPrint("-->Single Byte Mask Char='" + SingleByteChr + "'");
-                               CmnUtils.infoPrint("-->Double Byte Mask Char='" + DoubleByteChr + "'");
+                               CmnUtils.infoPrint("-->Masking Pattern=" + maskPattern.toUpperCase());
+                               if(isInclColsMask)CmnUtils.infoPrint("-->Masking Columns='" + inclMaskCols.toUpperCase() + "'");
+                               if(isExclColsMask)CmnUtils.infoPrint("-->Exclude Masking Columns='" + exclMaskCols.toUpperCase() + "'");
+                               CmnUtils.infoPrint("-->Single Byte Mask Char='" + singleByteMaskChar + "'");
+                               CmnUtils.infoPrint("-->Double Byte Mask Char='" + doubleByteMaskChar + "'");
                        }
                        CmnUtils.infoPrint("Start DataUnload ---------------------------------------------");
 
-                       dao.select(sql_table_list);
+                       dao.select(sql_table_key_list);
                        alData = dao.getArrayList();
                        tb_count = dao.getColumnCount();
                        orders = 0;
@@ -357,16 +338,16 @@ public class RapideUnloader{
                        for(int i=0;i<alData.size();i++){
                                if ((i+1) % tb_count == 1){
                                        if ((i + 2 <alData.size()) && (!alData.get(i).equals(alData.get(i+2))) || (i + 2 == alData.size())) {
-                                               if(isInclTables && !CmnUtils.isMatch(aryInclTables,alData.get(i).toUpperCase())){
+                                               if(isInclTables && !CmnUtils.isMatch(inclTablesArray,alData.get(i).toUpperCase())){
                                                        CmnUtils.debugPrint("inclTables=" + inclTables);
-                                                       CmnUtils.debugPrint("table=" + alData.get(i) + "," +CmnUtils.isMatch(aryInclTables,alData.get(i).toUpperCase()));
+                                                       CmnUtils.debugPrint("table=" + alData.get(i) + "," +CmnUtils.isMatch(inclTablesArray,alData.get(i).toUpperCase()));
                                                        orders = 0;
                                                        order_columns = "";
                                                        continue;
                                                }
-                                               if(isExclTables && CmnUtils.isMatch(aryExclTables,alData.get(i).toUpperCase())){
+                                               if(isExclTables && CmnUtils.isMatch(exclTablesArray,alData.get(i).toUpperCase())){
                                                        CmnUtils.debugPrint("exclTables=" + exclTables);
-                                                       CmnUtils.debugPrint("table=" + alData.get(i) + "," +CmnUtils.isMatch(aryExclTables,alData.get(i).toUpperCase()));
+                                                       CmnUtils.debugPrint("table=" + alData.get(i) + "," +CmnUtils.isMatch(exclTablesArray,alData.get(i).toUpperCase()));
                                                        orders = 0;
                                                        order_columns = "";
                                                        continue;
@@ -403,18 +384,18 @@ public class RapideUnloader{
                                                        if(CmnUtils.isColString(alColTypeName.get(j))){
                                                                if(isMask){
                                                                        if(
-                                                                               (isInclMaskCols && 
-                                                                                !isExclMaskCols &&
-                                                                                CmnUtils.isMatch(aryInclMaskCols,alData.get(i).toUpperCase(),alColName.get(j).toUpperCase())
+                                                                               (isInclColsMask && 
+                                                                                !isExclColsMask &&
+                                                                                CmnUtils.isMatch(inclColsMaskArray,alData.get(i).toUpperCase(),alColName.get(j).toUpperCase())
                                                                                ) ||
-                                                                               (isInclMaskCols && 
-                                                                                isExclMaskCols &&
-                                                                                CmnUtils.isMatch(aryInclMaskCols,alData.get(i).toUpperCase(),alColName.get(j).toUpperCase()) &&
-                                                                                !CmnUtils.isMatch(aryExclMaskCols,alData.get(i).toUpperCase(),alColName.get(j).toUpperCase())
+                                                                               (isInclColsMask && 
+                                                                                isExclColsMask &&
+                                                                                CmnUtils.isMatch(inclColsMaskArray,alData.get(i).toUpperCase(),alColName.get(j).toUpperCase()) &&
+                                                                                !CmnUtils.isMatch(exclColsMaskArray,alData.get(i).toUpperCase(),alColName.get(j).toUpperCase())
                                                                                ) ||
-                                                                               (!isInclMaskCols && 
-                                                                                isExclMaskCols &&
-                                                                                !CmnUtils.isMatch(aryExclMaskCols,alData.get(i).toUpperCase(),alColName.get(j).toUpperCase())
+                                                                               (!isInclColsMask && 
+                                                                                isExclColsMask &&
+                                                                                !CmnUtils.isMatch(exclColsMaskArray,alData.get(i).toUpperCase(),alColName.get(j).toUpperCase())
                                                                                ) 
                                                                        ){
                                                                                CmnUtils.debugPrint("Mask Column=" + alColName.get(j).toUpperCase());
@@ -432,16 +413,16 @@ public class RapideUnloader{
                                                                if(
                                                                        (isInclCols && 
                                                                         !isExclCols &&
-                                                                        CmnUtils.isMatch(aryInclCols,alData.get(i).toUpperCase(), alColName.get(j).toUpperCase())
+                                                                        CmnUtils.isMatch(inclColsArray,alData.get(i).toUpperCase(), alColName.get(j).toUpperCase())
                                                                        ) ||
                                                                        (isInclCols && 
                                                                         isExclCols &&
-                                                                        CmnUtils.isMatch(aryInclCols,alData.get(i).toUpperCase(), alColName.get(j).toUpperCase()) &&
-                                                                        !CmnUtils.isMatch(aryExclCols,alData.get(i).toUpperCase(),alColName.get(j).toUpperCase())
+                                                                        CmnUtils.isMatch(inclColsArray,alData.get(i).toUpperCase(), alColName.get(j).toUpperCase()) &&
+                                                                        !CmnUtils.isMatch(exclColsArray,alData.get(i).toUpperCase(),alColName.get(j).toUpperCase())
                                                                        ) ||
                                                                        (!isInclCols && 
                                                                         isExclCols &&
-                                                                        !CmnUtils.isMatch(aryExclCols,alData.get(i).toUpperCase(),alColName.get(j).toUpperCase())
+                                                                        !CmnUtils.isMatch(exclColsArray,alData.get(i).toUpperCase(),alColName.get(j).toUpperCase())
                                                                        )
                                                                ){
                                                                        CmnUtils.debugPrint("column=" + alColName.get(j).toUpperCase());
@@ -489,29 +470,29 @@ public class RapideUnloader{
                                                                }
                                                                if (firstCol == lastCol){
                                                                        if(isQuotation){
-                                                                               pw.print("\"" + lnSprtr);
+                                                                               pw.print("\"" + lineSeparator);
                                                                        } else {
-                                                                               pw.print("" + lnSprtr);
+                                                                               pw.print("" + lineSeparator);
                                                                        }
                                                                } else {
                                                                        if (j==lastCol){
                                                                                if(isQuotation){
-                                                                                       pw.print("\"" + lnSprtr);
+                                                                                       pw.print("\"" + lineSeparator);
                                                                                } else {
-                                                                                       pw.print("" + lnSprtr);
+                                                                                       pw.print("" + lineSeparator);
                                                                                }
                                                                        } else {
                                                                                if(colIncl[j]){
                                                                                        if(isQuotation){
-                                                                                               pw.print("\"" + dlmtr + "\"");
+                                                                                               pw.print("\"" + delimiter + "\"");
                                                                                        } else {
-                                                                                               pw.print(dlmtr);
+                                                                                               pw.print(delimiter);
                                                                                        }
                                                                                }
                                                                        }
                                                                }
                                                        }
-                                                       dao.getRecordToPrint(pw,dlmtr,isQuotation,isMask,firstCol,lastCol);
+                                                       dao.getRecordToPrint(pw,firstCol,lastCol);
                                                        dao.closeRecordSet();
                                                        pw.close();
                                                        pw = null;