oracle-databasejdbcldapoledbtnsnames

Oracle JDBC-URL with LDAP to OLE DB connect string - how?


I've got a JDBC-URL like such to connect to an Oracle 12c database:

jdbc:oracle:thin:@ldap://oraldap:389/thisdb,cn=OracleContext,dc=world

As can be seen, connection happens through LDAP.

Now I want to connect to same database via "Oracle Provider for OLE DB". Question is, what should I enter as data source here? Tried "ldap://oraldap:389/thisdb,cn=OracleContext,dc=world" - but this naturally didn't work. As far as I understand, I could enter a TNS-string like (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SERVICE_NAME=MyOracleSID)))- but I didn't gather how to represent the ldap-part.

What's the way to do this?


Solution

  • Ok, solved - I needed to have the tns-configuration files from Oracle. So namely it is the files ldap.ora, sqlnet.ora and tnsnames.ora which I put into a specific folder plus creating the environment variable TNS_ADMIN. For connecting through OLE_DB I enter the database name as data source - and it works!