GithubHelp home page GithubHelp logo

Comments (2)

Michael-A-McMahon avatar Michael-A-McMahon commented on June 9, 2024

You'll need to remove the space characters in the descriptor.

Here's some code I wrote to test this out. You can see after replace(" ", ""), the descriptor URL does not result in an error.

import io.r2dbc.spi.ConnectionFactories;
import io.r2dbc.spi.ConnectionFactory;

public class DescriptorTest {

  public static void main(String[] args) {

    String descriptorUrl =
        "r2dbc:oracle://?oracle.r2dbc.descriptor=(DESCRIPTION =" +
            "(ADDRESS = " +
            " (PROTOCOL = TCP)" +
            "(HOST = hostname)(PORT = portnum))" +
            " (CONNECT_DATA = " +
            "(SERVER = DEDICATED)" +
            " (SERVICE_NAME = servicename)))";

    tryUrl(descriptorUrl);

    descriptorUrl = descriptorUrl.replace(" ", "");
    tryUrl(descriptorUrl);
  }

  static void tryUrl(String url) {
    System.out.println("Trying:\n" + url);
    try {
      ConnectionFactory connectionFactory =
          ConnectionFactories.get(url);
    }
    catch (Exception exception) {
      System.out.println(exception.getMessage());
    }
  }
}

Compared to JDBC, R2DBC is more strict about the URL format. URLs must comply with RFC 3986. This is summarized in the R2DBC Specification here: https://r2dbc.io/spec/1.0.0.RELEASE/spec/html/#overview.connection.url
With this specification, a space character may not appear in the query section of the URL (the section following the ? character).

Hope this helps.

from oracle-r2dbc.

Michael-A-McMahon avatar Michael-A-McMahon commented on June 9, 2024

I'm closing this issue now. I hope it was resolved.

from oracle-r2dbc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.