Builder34 opened a new issue, #11399:
URL: https://github.com/apache/skywalking/issues/11399

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/skywalking/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Apache SkyWalking Component
   
   Java Agent (apache/skywalking-java)
   
   ### What happened
   
   `@Test
       public void testParseOracleTNSName2() {
           ConnectionInfo connectionInfo = new 
URLParser().parser("jdbc:oracle:thin:@(description=(address=(protocol=tcp)(host=localhost)(port=1521))(connect_data=(service_name=rac)))");
           //ConnectionInfo connectionInfo = new 
URLParser().parser("jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=RAC)))");
           assertThat(connectionInfo.getDBType(), is("Oracle"));
           assertThat(connectionInfo.getDatabaseName(), is("rac"));
           assertThat(connectionInfo.getDatabasePeer(), is("localhost:1521"));
       }`
   
   use lower case oracle tns url will error occurred, error message: 
   
   `java.lang.StringIndexOutOfBoundsException: begin 18, end 16, length 116
   
        at java.base/java.lang.String.checkBoundsBeginEnd(String.java:3319)
        at java.base/java.lang.String.substring(String.java:1874)
        at 
org.apache.skywalking.apm.plugin.jdbc.connectionurl.parser.AbstractURLParser.fetchDatabaseHostsFromURL(AbstractURLParser.java:50)
        at 
org.apache.skywalking.apm.plugin.jdbc.connectionurl.parser.OracleURLParser.commonsURLParse(OracleURLParser.java:101)
        at 
org.apache.skywalking.apm.plugin.jdbc.connectionurl.parser.OracleURLParser.parse(OracleURLParser.java:96)
        at 
org.apache.skywalking.apm.plugin.jdbc.connectionurl.parser.URLParser.parser(URLParser.java:61)
        at 
org.apache.skywalking.apm.plugin.jdbc.connectionurl.parser.URLParserTest.testParseOracleTNSName2(URLParserTest.java:118)
        at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)`
   
   
   
   
   ### What you expected to happen
   
   support parse lower case oracle tns url
   
   ### How to reproduce
   
   
`jdbc:oracle:thin:@(description=(address=(protocol=tcp)(host=localhost)(port=1521))(connect_data=(service_name=rac)))`
   use above example like this tns url will casued error
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit a pull request to fix on your own?
   
   - [X] Yes I am willing to submit a pull request on my own!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: 
notifications-unsubscr...@skywalking.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to