[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: JDBC-LDAP bridge: [LDAP: error code 32 - No such object]
Hello,
I'm hoping someone can help me. I have also had this problem. I was using
the jdbc-ldap bridge driver in jsp and I never noticed it until I tried to
write the simple app below to run from the command line. The driver loads
and the query runs just fine but I get the following error just after the
.getConnection statement.
javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object];
remaining name 'dc=mydomain,dc=com'
Just after the error the query is executed and the recordset is output just
fine. I've tried to change the user attribute in that line from
"cn=manager,dc=mysite,dc=com" to "cn=manager" but I get an Invalid
Credentials error. I also tried to change the "From ou=email" in the query
to "From " and the query will search everything under the basedn. This also
returns the correct recordset. However, the error persists. This has me
totally confused. How can I be getting this error and yet still have the
query return the correct results?
Thanks for any help you can give me.
Steve Cutrell
// Load the driver
Class.forName("com.octetstring.jdbcLdap.sql.JdbcLdapDriver");
// Connect to database
String ldapConnectString =
"jdbc:ldap://192.168.0.5:389/dc=mydomain,dc=com?SEARCH_SCOPE:=subTreeScope";
conn =
DriverManager.getConnection(ldapConnectString,"cn=manager,dc=mysite,dc=com",
"mypassword");
// run query
query = "SELECT cn,uid FROM ou=email WHERE sn=Smith";
statement = conn.createStatement();
rs = statement.executeQuery(query);
// return the results
while (rs.next()) {
System.out.println("cn=" + rs.getString("cn") + " and uid=" +
rs.getString("uid"));
}
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.522 / Virus Database: 320 - Release Date: 2003-09-29