* More proper fix for http://sourceforge.net/forum/forum.php?thread_id=1633220&forum_id=610548
This commit is contained in:
parent
395e00615c
commit
4f27e00a36
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue