JDBC connection to Oracle Unified Directory?

239 views Asked by At

I was looking for a guide or document if it is possible for jdbc to connect to OUD. Can anyone advise if this can be done? Basically JDBC -> OUD -> Oracle DB. Hoping for guidance, specially on the connection string.

I'm hoping to find a way to use jdbc to connect to oracle database via OUD.

2

There are 2 answers

7
pmdba On

If you are trying to authenticate database users using OUD (essentially LDAP), then you are thinking of this the wrong way:

JDBC -> OUD -> Oracle DB

should rather look like

JDBC -> Oracle DB <-> OUD (LDAP)

You still connect directly to the Oracle Database. The database user is configured to be authenticated by an external/enterprise service like OUD rather than locally by the database. The database reaches out to the LDAP service with the credentials (username/password) that you have provided and the LDAP service determines whether or not you should be allowed to access the database resource.

There is no modification of the connect string for LDAP authentication - this is entirely about how the user account and database are configured. Users must be pre-configured for external authentication and cannot be authenticated both locally and externally at the same time.

See here for documentation: https://docs.oracle.com/en/database/oracle/oracle-database/19/dbseg/configuring-authentication.html#GUID-FD72C458-E250-46D3-84B6-FF3F34CDAC5D

0
Aram On

Oracle JDBC Thin driver supports both LDAP and LDAPS to connect to OUD. OUD can be used for retrieving the database connection URL.

LDAP Syntax : "jdbc:oracle:thin:@ldap://myldapserver.example.com:7777/sales,cn=OracleContext,dc=com"

LDAPS Syntax : "jdbc:oracle:thin:@ldaps://myldapserver.example.com:7777/sales,cn=OracleContext,dc=com"

You can find the documentation here: https://docs.oracle.com/en/database/oracle/oracle-database/19/jjdbc/data-sources-and-URLs.html#GUID-F1841136-BE7C-47D4-8AEE-E9E78CA1213D