@@ -191,22 +191,22 @@ are supported by Oracle R2DBC:
191
191
- ` HOST `
192
192
- ` PORT `
193
193
- ` 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_ .
194
197
- ` USER `
195
198
- ` PASSWORD `
196
199
- ` SSL `
197
200
- ` CONNECT_TIMEOUT `
198
201
- ` 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"
203
204
204
205
#### Support for Extended R2DBC Options
205
206
Oracle R2DBC extends the standard set of R2DBC options to offer functionality
206
207
that is specific to Oracle Database and the Oracle JDBC Driver. Extended options
207
208
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.
210
210
211
211
#### Configuring an Oracle Net Descriptor
212
212
The ` oracle.r2dbc.OracleR2dbcOptions.DESCRIPTOR ` option may be used to configure
@@ -234,6 +234,22 @@ located:
234
234
r2dbc:oracle://?oracle.r2dbc.descriptor=myAlias&TNS_ADMIN=/path/to/tnsnames/
235
235
```
236
236
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
+
237
253
#### Configuring a java.util.concurrent.Executor
238
254
The ` oracle.r2dbc.OracleR2dbcOptions.EXECUTOR ` option configures a
239
255
` java.util.concurrent.Executor ` for executing asynchronous callbacks. The
@@ -508,12 +524,13 @@ for the out parameters is emitted last, after the `Result` for each cursor.
508
524
Oracle R2DBC supports type mappings between Java and SQL for non-standard data
509
525
types of Oracle Database.
510
526
511
- | Oracle SQL Type | Java Type |
512
- | ---------------------------------------------------------------------------------------------------------------------------------------------------------| -----------|
513
- | [ JSON] ( https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf/Data-Types.html#GUID-E441F541-BA31-4E8C-B7B4-D2FB8C42D0DF ) | ` javax.json.JsonObject ` or ` oracle.sql.json.OracleJsonObject ` |
514
- | [ DATE] ( https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf/Data-Types.html#GUID-5405B652-C30E-4F4F-9D33-9A4CB2110F1B ) | ` java.time.LocalDateTime ` |
515
- | [ INTERVAL DAY TO SECOND] ( https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf/Data-Types.html#GUID-B03DD036-66F8-4BD3-AF26-6D4433EBEC1C ) | ` java.time.Duration ` |
516
- | [ INTERVAL YEAR TO MONTH] ( https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf/Data-Types.html#GUID-ED59E1B3-BA8D-4711-B5C8-B0199C676A95 ) | ` java.time.Period ` |
527
+ | Oracle SQL Type | Java Type |
528
+ | ---------------------------------------------------------------------------------------------------------------------------------------------------------| ---------------------------------------------------------------|
529
+ | [ JSON] ( https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf/Data-Types.html#GUID-E441F541-BA31-4E8C-B7B4-D2FB8C42D0DF ) | ` javax.json.JsonObject ` or ` oracle.sql.json.OracleJsonObject ` |
530
+ | [ DATE] ( https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf/Data-Types.html#GUID-5405B652-C30E-4F4F-9D33-9A4CB2110F1B ) | ` java.time.LocalDateTime ` |
531
+ | [ INTERVAL DAY TO SECOND] ( https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf/Data-Types.html#GUID-B03DD036-66F8-4BD3-AF26-6D4433EBEC1C ) | ` java.time.Duration ` |
532
+ | [ INTERVAL YEAR TO MONTH] ( https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf/Data-Types.html#GUID-ED59E1B3-BA8D-4711-B5C8-B0199C676A95 ) | ` java.time.Period ` |
533
+ | [ SYS_REFCURSOR] ( https://docs.oracle.com/en/database/oracle/oracle-database/21/lnpls/static-sql.html#GUID-470A7A99-888A-46C2-BDAF-D4710E650F27 ) | ` io.r2dbc.spi.Result ` |
517
534
> Unlike the standard SQL type named "DATE", the Oracle Database type named
518
535
> "DATE" stores values for year, month, day, hour, minute, and second. The
519
536
> standard SQL type only stores year, month, and day. LocalDateTime objects are able
@@ -600,6 +617,36 @@ Publisher<Integer[]> arrayMapExample(Result result) {
600
617
return result. map(readable - > readable. get(" arrayValue" , Integer []. class));
601
618
}
602
619
```
620
+
621
+ ### REF Cursor
622
+ Use the ` oracle.r2dbc.OracleR2dbcTypes.REF_CURSOR ` type to bind ` SYS_REFCURSOR ` out
623
+ parameters:
624
+ ``` java
625
+ Publisher<Result > executeProcedure(Connection connection) {
626
+ connection. createStatement(
627
+ " BEGIN example_procedure(:cursor_parameter); END;" )
628
+ .bind(" cursor_parameter" , Parameters . out(OracleR2dbcTypes . REF_CURSOR ))
629
+ .execute()
630
+ }
631
+ ```
632
+ A ` SYS_REFCURSOR ` out parameter can be mapped to an ` io.r2dbc.spi.Result ` :
633
+ ``` java
634
+ Publisher<Result > mapOutParametersResult(Result outParametersResult) {
635
+ return outParametersResult. map(outParameters - >
636
+ outParameters. get(" cursor_parameter" , Result . class));
637
+ }
638
+ ```
639
+ The rows of a ` SYS_REFCURSOR ` may be consumed from the ` Result ` it is
640
+ mapped to:
641
+ ``` java
642
+ Publisher<ExampleObject > mapRefCursorRows(Result refCursorResult) {
643
+ return refCursorResult. map(row - >
644
+ new ExampleObject (
645
+ row. get(" id_column" , Long . class),
646
+ row. get(" value_column" , String . class)));
647
+ }
648
+ ```
649
+
603
650
## Secure Programming Guidelines
604
651
The following security related guidelines should be adhered to when programming
605
652
with the Oracle R2DBC Driver.
0 commit comments