[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: JDBC-LDAP bridge driver error



Well,


>   // PreparedStatement  pstmt = null;
>   String stmt =  "SELECT cn,o,c FROM c=INDIA WHERE c=?";
>   PreparedStatement pstmt = con.prepareStatement(stmt);
>   ResultSet rs = pstmt.executeQuery(stmt);


The code above won't work, as you haven't set any value for your select
statement. You need to set the "?" to something.

But from the exception below it appears that you aren't even getting that
far. I would guess that from the exception (No Such Object) that you don't
have any object 'cn=CIMOM,o=WSSPL,C=INDIA' in your LDAP.

Verify the following:

1) Your LDAP URL is correct for your driver manager

2) You have such an object in your LDAP

3) Said object has a userPassword field.

4) You can bind and do your search using an LDAP client - like 'ldapsearch'


Once you verify all of the above work, it is an issue with your client.


If you have any questions about how LDAP JDBC works, I suggest looking to
a JAVA discussion, not this OpenLDAP discussion. If you decide that you
are having an issue with operating the OpenLDAP software, please post your
questions here.

Again, for JAVA questions, I would suggest posing your questions to the
SeaJUG list: www.seajug.org

Best of luck!
-lon



> javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such
> Object]; remaining name 'cn=CIMOM,o=WSSPL,C=INDIA'
>        at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:2889) at
>        com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2810)
>        at
>        com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2616)
>        at com.sun.jndi.ldap.LdapCtx.c_lookup(LdapCtx.java:931)
>        at
> com.sun.jndi.toolkit.ctx.ComponentContext.p_lookup(ComponentContext.java:522> )
>        at
> com.sun.jndi.toolkit.ctx.PartialCompositeContext.lookup(PartialCompositeCont> ext.java:155)
>        at
> com.sun.jndi.toolkit.ctx.PartialCompositeContext.lookup(PartialCompositeCont> ext.java:144)
>        at javax.naming.InitialContext.lookup(InitialContext.java:347)
>        at
> com.octetstring.jdbcLdap.jndi.JndiLdapConnection.isClosed(JndiLdapConnection> .java:270)
>        at
> com.octetstring.jdbcLdap.jndi.JndiLdapConnection.<init>(JndiLdapConnection.j> ava:241)
>        at
> com.octetstring.jdbcLdap.sql.JdbcLdapDriver.connect(JdbcLdapDriver.java:75)
>        at java.sql.DriverManager.getConnection(DriverManager.java:512)
>        at java.sql.DriverManager.getConnection(DriverManager.java:512)
>        at java.sql.DriverManager.getConnection(DriverManager.java:171)
>        at driver.main(driver.java:17)
>        exception
>
> ====================================