DB2SidHelper.java
1.07 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
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;
}
}
}