Commit c13d67b9 c13d67b927d9b1ba3c5dceaa10364de121481337 by Christian Gerdes

Bug in parsing the short version jdbc connection string

1 parent b747bb02
......@@ -94,11 +94,11 @@ public class OraMonRESTgetData extends HttpServlet {
}
String conStr, usrStr, pwdStr;
if(serviceName) {
conStr = "jdbc:oracle:thin:@" + conStrParamArray[0] + ":" + conStrParamArray[1];
conStr = "jdbc:oracle:thin:@//" + conStrParamArray[0] + ":" + conStrParamArray[1];
usrStr = conStrParamArray[2];
pwdStr = conStrParamArray[3];
} else {
conStr = "jdbc:oracle:thin:@" + conStrParamArray[0] + ":" + conStrParamArray[1] + ":" + conStrParamArray[2];
conStr = "jdbc:oracle:thin:@//" + conStrParamArray[0] + ":" + conStrParamArray[1] + ":" + conStrParamArray[2];
usrStr = conStrParamArray[3];
pwdStr = conStrParamArray[4];
}
......
......@@ -89,9 +89,9 @@ public class OraMonRESTgetMetrics extends HttpServlet {
}
String conStr;
if(serviceName) {
conStr = "jdbc:oracle:thin:@" + conStrParamArray[0] + ":" + conStrParamArray[1];
conStr = "jdbc:oracle:thin:@//" + conStrParamArray[0] + ":" + conStrParamArray[1];
} else {
conStr = "jdbc:oracle:thin:@" + conStrParamArray[0] + ":" + conStrParamArray[1] + ":" + conStrParamArray[2];
conStr = "jdbc:oracle:thin:@//" + conStrParamArray[0] + ":" + conStrParamArray[1] + ":" + conStrParamArray[2];
}
monitor = Registry.find(conStr);
if(monitor == null) {
......
......@@ -17,7 +17,9 @@ public class TestRunner {
//ArrayList<OraMon> oraList = new ArrayList<OraMon>();
ArrayList<OraMon> oraList = Registry.getList();
OraMon mon1 = new OraMon("jdbc:oracle:thin:@uvp3dbkappkg:1550:VP1K03","dbsnmp","dbsnmp"); // SID eller Service Name format
//OraMon mon1 = new OraMon("jdbc:oracle:thin:@uvp3dbkappkg:1550:VP1K03","dbsnmp","dbsnmp"); // SID eller Service Name format
//OraMon mon1 = new OraMon("jdbc:oracle:thin:@//u00154.kap.rsv.se:1526/DB1K01","dbsnmp","dbsnmp");
OraMon mon1 = new OraMon("jdbc:oracle:thin:@//u03634.kap.rsv.se:1526/DA1K001","dbsnmp","dbsnmp");
//OraMon mon2 = new OraMon("jdbc:oracle:thin:@host:port:sid","user","pass"); // SID format
mon1.open();
//mon2.open();
......