DB2SidHelper.java 1.07 KB
package com.sitech.ismp.coll.tivoli.db2;

import java.util.ResourceBundle;

public class DB2SidHelper
{	
        static ResourceBundle ORACLE_HOST_NAME = null;

        static {
            try{
            	ORACLE_HOST_NAME = ResourceBundle.getBundle("oracle_host_name");                                             
            }
            catch(Exception e){
                System.out.println("Bundle oracle_host_name.properties error.");
                e.printStackTrace();
            }
        }
        
        /**
         * 根据oracle host_name返回相应的sid
         * lianlian 2006-09-22
         * @param host_name
         * @return
         */
        public static String getSid(String host_name)
        {
        	String temp_sid="";
        	if(host_name==null)
        	{
        		return temp_sid;
        	}
        	
        	Object obj =  ORACLE_HOST_NAME.getObject(host_name);
        	if(obj==null)
        	{
        		return temp_sid;
        	}
        	else
        	{
        		temp_sid = (String)obj;
        		return temp_sid;
        	}
        }
}