Hello,
I'm trying to use Oracle JDBC driver 10.1.0.5 to access my LDAP server. After reading
http://download.oracle.com/docs/cd/B28359_01/java.111/b31224/urls.htm#CHDBICFA
I wrote the following code:
import oracle.jdbc.pool.OracleDataSource;
import java.sql.Connection;
import java.util.Properties;
public class TestLdap {
private static OracleDataSource ods;
private static Connection cnx;
public static void main (String args[]) {
Properties prop = new Properties();
String url = "jdbc:oracle:thin:@ldap://ldap-server:389/";
try {
ods = new OracleDataSource();
ods.setURL(url);
ods.setConnectionCachingEnabled(true);
cnx = ods.getConnection("CN=Admin,O=COHERIS,C=FR", "password");
} catch (java.sql.SQLException se) {
se.printStackTrace();
}
}
}
It fails with java.sql.SQLException: Exception d'E/S: JNDI Package failurejavax.naming.InvalidNameException: cn=: [LDAP: error code 34 - Invalid DN Syntax]; remaining name 'cn='
I have tried many different URLs, but couldn't get a working Connection.
My LDAP server is Domino 6.5, but I did some testing with OpenLDAP 2.0 and had the same results.
Does anyone has an example ? This Oracle JDBC driver feature seems quite uncommon, and I couldn't find any example on the Internet.
Thanks
David Le Borgne