OSDN Git Service

20170128
[rapideact/rapideact.git] / com / rapide_act / CmnProperty.java
index ff513cb..f5a94d4 100644 (file)
@@ -73,7 +73,8 @@ public class CmnProperty{
        protected String [] prop_val = new String[KEYS];
        protected static final String [] MASK_PTN = {"ALL", "ALT", "EDGE"};
        protected static final String DEFAULT_IN_FOLDER = "input";
-       protected static final String DEFAULT_PROP_FILE = "RapideLoader.properties";
+       protected static final String DEFAULT_OUT_FOLDER = "output";
+       protected static final String DEFAULT_PROP_FILE = "RapideAct.properties";
        protected static String [] tSqlArray = {
                "select "
                + " table_name "
@@ -162,7 +163,7 @@ public class CmnProperty{
                Properties prop = null;
                try {
                        prop = new Properties();
-                       br = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(_propFile), "UTF-8"));
+                       br = new BufferedReader(new InputStreamReader(CmnProperty.class.getClassLoader().getResourceAsStream(_propFile), "UTF-8"));
                        prop.load(br);
                        for(int i=0;i<KEYS;i++){
                                prop_val[i] = prop.getProperty(database + "." +PROP_KEY[i]);
@@ -170,7 +171,7 @@ public class CmnProperty{
                        br.close();
                        br = null;
                } catch (NullPointerException e) {
-                               throw new Exception("Property File (" + _propFile +") Not Found");
+                               throw new Exception("\83v\83\8d\83p\83e\83B\83t\83@\83C\83\8b\82ª\8c©\82Â\82©\82è\82Ü\82¹\82ñ\81B[" + _propFile +"]");
                } catch (IOException e) {
                                throw e;
                }
@@ -222,7 +223,7 @@ public class CmnProperty{
                if(!CmnUtils.isEmpty(prop_val[D_TBLKEYSQL]))tkSql = 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_BATCOUNT]) && CmnUtils.isNumeric(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;
@@ -246,14 +247,14 @@ public class CmnProperty{
                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");
-               } else if (pass == null){
-                       throw new Exception("pass is null");
-               } else if (url == null){
-                       throw new Exception("url is null");
-               } else if (driver == null){
-                       throw new Exception("driver is null");
+               if(CmnUtils.isEmpty(user)){
+                       throw new Exception("us(\83\86\81[\83UID)\82ª\96¢\8ew\92è\82Å\82·\81B");
+               } else if (CmnUtils.isEmpty(pass)){
+                       throw new Exception("pw(\83p\83X\83\8f\81[\83h)\82ª\96¢\8ew\92è\82Å\82·\81B");
+               } else if (CmnUtils.isEmpty(url)){
+                       throw new Exception("url(\90Ú\91±\8fî\95ñ)\82ª\96¢\8ew\92è\82Å\82·\81B");
+               } else if (CmnUtils.isEmpty(driver)){
+                       throw new Exception("dr(\83h\83\89\83C\83o)\82ª\96¢\8ew\92è\82Å\82·\81B");
                }
                
                for(int i = 0;i<DB_TYPE_NAME.length;i++){
@@ -266,21 +267,13 @@ public class CmnProperty{
                if (dbType != DB_TYPE_UNKNOWN){
                        if(!CmnUtils.isEmpty(prop_val[D_TBLSQL])){
                                tSql = prop_val[D_TBLSQL];
-                       } else {
-                               tSql = tSqlArray[dbType];
-                       }
-               } else {
-                       throw new Exception("dbtype unknown");
-               }
-
-               if (dbType != DB_TYPE_UNKNOWN){
-                       if(!CmnUtils.isEmpty(prop_val[D_TBLKEYSQL])){
                                tkSql = prop_val[D_TBLKEYSQL];
                        } else {
+                               tSql = tSqlArray[dbType];
                                tkSql = tkSqlArray[dbType];
                        }
                } else {
-                       throw new Exception("dbtype unknown");
+                       throw new Exception("\83f\81[\83^\83x\81[\83X\90»\95i\82ª\8e¯\95Ê\82Å\82«\82Ü\82¹\82ñ\81B[" + url + "]");
                }
 
                if(database!=null)CmnUtils.infoPrint("-->\91Î\8fÛ\83f\81[\83^\83x\81[\83X='" + database.toUpperCase() + "'");