Skip to content

Commit 4b68ec7

Browse files
Merge pull request #99 from oracle/40-ldap-support
LDAP Support
2 parents 6b59e57 + e0e434b commit 4b68ec7

11 files changed

+991
-256
lines changed

README.md

+22-6
Original file line numberDiff line numberDiff line change
@@ -191,22 +191,22 @@ are supported by Oracle R2DBC:
191191
- `HOST`
192192
- `PORT`
193193
- `DATABASE`
194+
- The database option is interpreted as the
195+
[service name](https://docs.oracle.com/en/database/oracle/oracle-database/21/netag/identifying-and-accessing-database.html#GUID-153861C1-16AD-41EC-A179-074146B722E6)
196+
of an Oracle Database instance. _System Identifiers (SID) are not recognized_.
194197
- `USER`
195198
- `PASSWORD`
196199
- `SSL`
197200
- `CONNECT_TIMEOUT`
198201
- `STATEMENT_TIMEOUT`.
199-
200-
> Oracle R2DBC interprets the `DATABASE` option as the
201-
> [service name](https://docs.oracle.com/en/database/oracle/oracle-database/21/netag/identifying-and-accessing-database.html#GUID-153861C1-16AD-41EC-A179-074146B722E6)
202-
> of an Oracle Database instance. _System Identifiers (SID) are not recognized_.
202+
- `PROTOCOL`
203+
- (For inclusion in the next release) Accepted protocol values are "tcps", "ldap", and "ldaps"
203204

204205
#### Support for Extended R2DBC Options
205206
Oracle R2DBC extends the standard set of R2DBC options to offer functionality
206207
that is specific to Oracle Database and the Oracle JDBC Driver. Extended options
207208
are declared in the
208-
[OracleR2dbcOptions](src/main/java/oracle/r2dbc/OracleR2dbcOptions.java)
209-
class.
209+
[OracleR2dbcOptions](src/main/java/oracle/r2dbc/OracleR2dbcOptions.java) class.
210210

211211
#### Configuring an Oracle Net Descriptor
212212
The `oracle.r2dbc.OracleR2dbcOptions.DESCRIPTOR` option may be used to configure
@@ -234,6 +234,22 @@ located:
234234
r2dbc:oracle://?oracle.r2dbc.descriptor=myAlias&TNS_ADMIN=/path/to/tnsnames/
235235
```
236236

237+
#### (For inclusion in the next release) Configuring an LDAP URL
238+
Use `ldap` or `ldaps` as the URL protocol to have an Oracle Net Descriptor
239+
retrieved from an LDAP server:
240+
```
241+
r2dbc:oracle:ldap://ldap.example.com:7777/sales,cn=OracleContext,dc=com
242+
r2dbc:oracle:ldaps://ldap.example.com:7778/sales,cn=OracleContext,dc=com
243+
```
244+
Use a space separated list of LDAP URIs for fail over and load balancing:
245+
```
246+
r2dbc:oracle:ldap://ldap1.example.com:7777/sales,cn=OracleContext,dc=com%20ldap://ldap2.example.com:7777/sales,cn=OracleContext,dc=com%20ldap://ldap3.example.com:7777/sales,cn=OracleContext,dc=com
247+
```
248+
> Space characters in a URL must be percent encoded as `%20`
249+
250+
An LDAP server request will **block a thread for network I/O** when Oracle R2DBC
251+
creates a new connection.
252+
237253
#### Configuring a java.util.concurrent.Executor
238254
The `oracle.r2dbc.OracleR2dbcOptions.EXECUTOR` option configures a
239255
`java.util.concurrent.Executor` for executing asynchronous callbacks. The

pom.xml

+12-1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,17 @@
8787
<arg>-Xlint:-processing</arg>
8888
<arg>-Xlint:-serial</arg>
8989
</compilerArgs>
90+
<!-- LDAP URL tests require the java.naming module -->
91+
<!-- Maven seems to ignore the forceJavacCompilerUse.
92+
This results in an error when passing the addModules option to
93+
the javax.tools API. For this reason, Oracle R2DBC's module-info is
94+
declaring a depency on the java.naming module.
95+
TODO: Figure out how to make maven compile tests correctly, and
96+
remove the java.naming depenency from Oracle R2DBC.
97+
<fork>true</fork>
98+
<forceJavacCompilerUse>true</forceJavacCompilerUse>
99+
<testCompilerArgument>- -add-modules java.naming</testCompilerArgument>
100+
-->
90101
<showWarnings>true</showWarnings>
91102
<release>${java.version}</release>
92103
</configuration>
@@ -150,6 +161,7 @@
150161
<artifactId>maven-surefire-plugin</artifactId>
151162
<version>3.0.0-M5</version>
152163
<configuration>
164+
<!-- Include tests in the oracle.r2dbc.test package -->
153165
<includes>
154166
<include>**/*Test.java</include>
155167
<include>**/*TestKit.java</include>
@@ -278,7 +290,6 @@
278290
<artifactId>reactor-test</artifactId>
279291
<scope>test</scope>
280292
</dependency>
281-
282293
</dependencies>
283294

284295
<profiles>

src/main/java/module-info.java

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
with oracle.r2dbc.impl.OracleConnectionFactoryProviderImpl;
3131

3232
requires java.sql;
33+
requires java.naming;
3334
requires com.oracle.database.jdbc;
3435
requires reactor.core;
3536
requires transitive org.reactivestreams;

0 commit comments

Comments
 (0)