Heng Sin Low 2006-12-16 07:36:50 +00:00
parent 395e00615c
commit 4f27e00a36
1 changed files with 12 additions and 3 deletions

View File

@ -91,7 +91,10 @@ public class ConfigOracle extends Config
{ {
String serviceName = "xe"; String serviceName = "xe";
if (!list.contains(serviceName)) if (!list.contains(serviceName))
{
list.add(serviceName); list.add(serviceName);
dblist.add(serviceName);
}
} }
String path = System.getenv("ORACLE_HOME"); String path = System.getenv("ORACLE_HOME");
@ -108,12 +111,15 @@ public class ConfigOracle extends Config
StringBuffer sb = getTNS_File (entries[e].substring(0, entries[e].length()-4)); StringBuffer sb = getTNS_File (entries[e].substring(0, entries[e].length()-4));
String[] tnsnames = getTNS_Names (sb, true); String[] tnsnames = getTNS_Names (sb, true);
String[] dbNames = getTNS_Names (sb, false); String[] dbNames = getTNS_Names (sb, false);
//fallback to tnsnames
if (dbNames == null) dbNames = tnsnames;
if (tnsnames != null) if (tnsnames != null)
{ {
for (int i = 0; i < dbNames.length; i++) //before was: for (int i = 0; i < tnsnames.length; i++) for (int i = 0; i < tnsnames.length; i++)
{ {
String tns = tnsnames[i]; // is lower case String tns = tnsnames[i]; // is lower case
String db = dbNames[i]; //check bound, fallback to tnsname
String db = (i < dbNames.length) ? dbNames[i] : tns;
if (!tns.equals(def)) { if (!tns.equals(def)) {
list.add(tns); list.add(tns);
dblist.add(db); dblist.add(db);
@ -132,12 +138,15 @@ public class ConfigOracle extends Config
StringBuffer sb = getTNS_File (path); StringBuffer sb = getTNS_File (path);
String[] tnsnames = getTNS_Names (sb, true); String[] tnsnames = getTNS_Names (sb, true);
String[] dbNames = getTNS_Names (sb, false); String[] dbNames = getTNS_Names (sb, false);
//fallback to tnsnames
if (dbNames == null) dbNames = tnsnames;
if (tnsnames != null) if (tnsnames != null)
{ {
for (int i = 0; i < tnsnames.length; i++) for (int i = 0; i < tnsnames.length; i++)
{ {
String tns = tnsnames[i]; // is lower case String tns = tnsnames[i]; // is lower case
String db = dbNames[i]; //check bound, fallback to tnsname
String db = (i < dbNames.length) ? dbNames[i] : tns;
if (!tns.equals(def)) { if (!tns.equals(def)) {
list.add(tns); list.add(tns);
dblist.add(db); dblist.add(db);