sententia
Home    Blog

Creating ColdFusion Data Source for Oracle DB via LDAP

Don't forget that I believe you also need to make sure that you have the class path for the oracle client driver (see prior blog entry on Java classes)
Found the basic syntax at: http://download.oracle.com/docs/cd/B14117_01/java.101/b10979/urls.htm 
  • For my environment, I grabbed the ldap server info (name, port, context) from SqlDeveloper.
  • JDBC URL:  jdbc:oracle:thin:@ldap://<server>:1389/<sid>,cn=OracleContext,dc=<mycompany>,dc=com
  • driver class:  oracle.jdbc.OracleDriver
Table 3-3 Supported Database Specifiers
Specifier Supported Drivers Example
Oracle Net connection descriptor Thin, OCI Thin, using an address list:
url="jdbc:oracle:thin:@(DESCRIPTION=
  (LOAD_BALANCE=on)
(ADDRESS_LIST=
  (ADDRESS=(PROTOCOL=TCP)(HOST=host1) (PORT=1521))
 (ADDRESS=(PROTOCOL=TCP)(HOST=host2)(PORT=1521)))
 (CONNECT_DATA=(SERVICE_NAME=service_name)))"

OCI, using a cluster:

"jdbc:oracle:oci:@(DESCRIPTION=
  (ADDRESS=(PROTOCOL=TCP)(HOST=cluster_alias)
    (PORT=1521))
    (CONNECT_DATA=(SERVICE_NAME=service_name)))" 
Thin-style service name Thin See "Thin-style Service Name Syntax" for details.
"jdbc:oracle:thin:scott/tiger@//myhost:1521/myservicename"
LDAP syntax Thin
"jdbc:oracle:thin:@ldap://ldap.acme.com:7777/sales,cn=OracleContext,dc=com"
or, when using SSL (see Note):
"jdbc:oracle:thin:@ldaps://ldap.acme.com:7777/sales,cn=OracleContext,dc=com"
Bequeath connection OCI Empty -- nothing after database name
"jdbc:oracle:oci:scott/tiger"
TNSNames alias OCI See "TNSNames Alias Syntax" for details.