-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Oracle Descriptor Option #114
Comments
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 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 Hope this helps. |
I'm closing this issue now. I hope it was resolved. |
Hi ,
I started using R2DBC recently and we have a descriptor in this Format,
(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = portnum)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = servicename)))
and When i tried connecting to R2DBC using this as below
r2dbc:oracle://?oracle.r2dbc.descriptor=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = portnum)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = servicename)))
My Spring app starts failing with Illegal Character error.
Can you please help providing a sample connection string for this use case or else any solution that will help.
Thanks in Advance!!
The text was updated successfully, but these errors were encountered: