title: "Invalid connection string format" error when trying to connect to Oracle using TNS alias that contains dot character
body: <p>I am trying to connect to Oracle database using TNS. </p>
  
  <p>The problem is that TNS alias contains dot, so when I am specifying url like this:</p>
  
  <pre><code>jdbc:oracle:thin:@TNS.ALIAS
  </code></pre>
  
  <p>I've got...</p>
  
  <pre><code>oracle.net.ns.NetException: Invalid connection string format, a valid format is: "host:port:sid"
  </code></pre>
  
  <p>...during creation of connection.</p>
  
  <p>I know that dot character is a problem, because after removing it from <code>tnsnames.ora</code> file connection to database works.</p>
  
  <p>My question is - is it possible to escape dot character somehow? Maybe there is some connection parameter that can be setup to allow dot character in alias? I would like to avoid removing dot from <code>tnsnames.ora</code> since i am getting the file from outside source. </p>
  
  <p>Here are the options that I've already tried that gave me the same error:</p>
  
  <pre><code>jdbc:oracle:thin:@"TNS.ALIAS"
  jdbc:oracle:thin:@\"TNS.ALIAS\"
  jdbc:oracle:thin:@`TNS.ALIAS`
  jdbc:oracle:thin:@TNS\.ALIAS - this one is not compiling
  jdbc:oracle:thin:@TNS\\.ALIAS
  jdbc:oracle:thin:@TNS&amp;#46;ALIAS
  jdbc:oracle:thin:@TNS\".\"ALIAS
  jdbc:oracle:thin:@TNS%2eALIAS
  </code></pre>
  
  <p>Here are the options that resulted with <code>oracle.net.ns.NetException: could not resolve the connect identifier</code>:</p>
  
  <pre><code>jdbc:oracle:thin:@TNSALIAS
  jdbc:oracle:thin:@TNS-ALIAS
  jdbc:oracle:thin:@TNS_ALIAS
  </code></pre>
  
  <p>Additional context:</p>
  
  <ul>
  <li>I am trying to create Java's <code>DataSource</code> (<code>OracleDataSource</code> to be
  strict) in Scala (it is Play Framework - but I am not using Play's
  way of creation of DB connections - I am doing it manually)</li>
  <li>I have SQL Developer that is using exactly the same <code>tnsnames.ora</code> file and it is working there </li>
  <li>We are having C# applications that are using exactly the same <code>tnsnames.ora</code> file and it is working there (data source is defined like this: <code>&lt;add name="connectionName" connectionString="Data Source=TNS.ALIAS;"/&gt;</code></li>
  </ul>