RHQ Oracle Plugin only connects to via SID, not Service Name
Created attachment 595366 [details] Patch to fix issue Updated the RHQ Oracle plugin so that it will connect to an Oracle database via a Service Name as well as a SID
Assuming we have Richard's fedora account info lets try and get this into rhq4.5.
Fedora user id is richardhensman
I may miss something, but those two alternatives look pretty identical to me. Shouldn't the part after "else" be different and somehow pass the service name? + if ( configuration.getSimpleValue("connectionMethod", "SID").equals("SID")) { + return "jdbc:oracle:thin:@" + configuration.getSimpleValue("host", "localhost") + ":" + + configuration.getSimpleValue("port", "1521") + ":" + configuration.getSimpleValue("sid", "XE"); + } else { + return "jdbc:oracle:thin:@" + configuration.getSimpleValue("host", "localhost") + ":" + + configuration.getSimpleValue("port", "1521") + "/" + configuration.getSimpleValue("sid", "XE");
The different in the slash '/' in the url when using a service name, and colon ':' when using a sid
Right - holy cow, I think I need glasses, coffee, sleep or beer :-) Thanks Heiko
(In reply to comment #4) > I may miss something, but those two alternatives look pretty identical to > me. Shouldn't the part after "else" be different and somehow pass the service > name? As Richard mentions, the "/" is new - replaces the ":" See the following: http://docs.oracle.com/cd/B14117_01/java.101/b10979/urls.htm#BEIDHCBA http://www.rojotek.com/blog/2008/01/04/oracle-sid-service_name/ Note that the oracle docs say double slashes should follow the @: Thin-style service names are supported only by the Thin driver. The syntax is: @//host_name:port_number/service_name I'll make that change before committing, just to be consistent with how Oracle says it should be.
git commit to master: fc82a357767f64e22356588cb5645f17fa626fc0 when using "Service Name" connection method, the JDBC URL to be used will be: jdbc:oracle:thin:@//<hostname>:<port>/<serviceName> If "SID" is the connection method used, the JDBC URL is the same as it has always been: jdbc:oracle:thin:@<hostname>:<port>:<sid> If an existing/legacy OracleServer is in inventory (and hence its plugin configuration does NOT have a connectionMethod property) then we assume a default of SID connection method and that latter JDBC URL format is still used.
Bulk closing of items that are on_qa and in old RHQ releases, which are out for a long time and where the issue has not been re-opened since.