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

RE: JDBC-LDAP bridge driver error



 Hi,

The ldapsearch  works.
Command which i gave is,

ldapsearch -h 134.15.15.4:9998 -D "o=WSSPL,c=INDIA" -b
"cn=CIMOM,o=WSSPL,c=INDIA" -x.

Now how do i specify this information in  jdbc-ldap driver  application, i.e
what should
i give in getConnection() and  SELECT statements etc.. so that it works.

Marc, i tried not giving "o=WSSPL, c=INDIA"  in credentials but no luck.  

The ldapsearch output is,
=========================
version: 2

#
# filter: (objectclass=*)
# requesting: ALL
#

# CIMOM, WSSPL, INDIA
dn: cn=CIMOM, o=WSSPL, c=INDIA
objectClass: top
objectClass: organization
objectClass: country
objectClass: person
cn: CIMOM
sn: CIMOM-Test
o: WSSPL
c: INDIA

#  nw1, CIMOM, WSSPL, INDIA
dn: cn= nw1,cn=CIMOM, o=WSSPL, c=INDIA
objectClass: top
objectClass: organization
objectClass: country
objectClass: person
objectClass: applicationProcess
cn: nw1
sn: CIMOM-Test
o: WSSPL
c: INDIA
 
 ...........
 ...........

===================

Thanks & Regards.

-----Original Message-----
From: Lon Tierney
To: Arun@WSSPL.com
Cc: openldap-software@openldap.org
Sent: 6/25/2003 11:40 PM
Subject: 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(PartialComposite
Cont> ext.java:155)
>        at
>
com.sun.jndi.toolkit.ctx.PartialCompositeContext.lookup(PartialComposite
Cont> ext.java:144)
>        at javax.naming.InitialContext.lookup(InitialContext.java:347)
>        at
>
com.octetstring.jdbcLdap.jndi.JndiLdapConnection.isClosed(JndiLdapConnec
tion> .java:270)
>        at
>
com.octetstring.jdbcLdap.jndi.JndiLdapConnection.<init>(JndiLdapConnecti
on.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
>
> ====================================