Blame view

src/com/sitech/ismp/coll/tivoli/db2/UaDB2Helper.java 1.3 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
package com.sitech.ismp.coll.tivoli.db2;

import java.util.ResourceBundle;

public class UaDB2Helper
{	
        static ResourceBundle UA_ORACLE_NAME = null;

        static {
            try{
            	UA_ORACLE_NAME = ResourceBundle.getBundle("ua_oracle_name");                                             
            }
            catch(Exception e){
                System.out.println("Bundle ua_oracle_name.properties error.");
                e.printStackTrace();
            }
        }

        
        /**
         * 返回ua oracle host name
         * lianlian 2006-09-22
         * @param host_name
         * @return
         */
        public static String getUaOracleName(String host_name)
        {
        	String temp_ua_oracle_host_name="";
        	if(host_name==null)
        	{
        		return temp_ua_oracle_host_name;
        	}
        	
        	Object obj =  UA_ORACLE_NAME.getObject(host_name);
        	if(obj==null)
        	{
        		return temp_ua_oracle_host_name;
        	}
        	else
        	{
        		temp_ua_oracle_host_name = (String)obj;
        		return temp_ua_oracle_host_name;
        	}
        }
        
        public static void main(String args[])
        {
        	String str = UaDB2Helper.getUaOracleName("BIINTF");
        	System.out.println(str);
        }
}