Simple example code connect Ldap server...

Hi all.
I am beginning working with Ldap.
Please help me a simple example source code to connect with Ldap server.
I install Ldap administrator and see a public Server : ldap://directory.d-trust.de:389 How to connect it ?
Thanks in advance
Diego

Hi ThuCT,
Just have a read of the following links :
http://www.javaworld.com/javaworld/jw-03-2000/jw-0324-ldap.html
http://java.sun.com/products/jndi/tutorial/ldap/index.html

Similar Messages

  • Sample code to connect LDAP server using jndi

    Hi,
    can any one help me with sample code to connect LDAP server using jndi,
    like i want to make use of Ldap server for serching Active directoty.
    Thanks in advance,
    Regards
    Muthu

    You can set ldap_auth=none for anonymous user.
    User/password is mandatory otherwise. Please refer to http://docs.oracle.com/cd/E21764_01/integrate.1111/e12644/appendix_ldap_driver.htm#CHDHCABH
    Thansk,

  • Simple example code to connect to SQL server 2002

    Hi,
    I found a good website a while back which showed step by step how to connect to a sql server DB using JDBC, a re-install of windows means I cant find it again. I have searched the web, but to no avail. Basically I need to find a step by step guide to using java to access data within MS SQL server 2000. It needs to include details about where to download suitable drivers etc. and example code so that I can originally test my connection before diving much deeper.
    Any help much appreciated.

    Hi:
    here is the code that you can use it to test your connect if you use MS sql 2000 free driver. Others, you need to make little change on
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"); and
    con = .......... parts
    goog luck !
    import java.sql.*;
    public class Connect{
    private java.sql.Connection con = null;
    private final String url = "jdbc:microsoft:sqlserver://";
    private final String serverName= "localhost";
    private final String portNumber = "1433";
    private final String databaseName= "pubs";
    private final String userName = "xxxxx";
    private final String password = "xxxxx";
    // Informs the driver to use server a side-cursor,
    // which permits more than one active statement
    // on a connection.
    private final String selectMethod = "cursor";
    // Constructor
    public Connect(){}
    private String getConnectionUrl(){
    return url+serverName+":"+portNumber+";databaseName="+databaseName+";selectMethod="+selectMethod+";";
    private java.sql.Connection getConnection(){
    try{
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    con = java.sql.DriverManager.getConnection(getConnectionUrl(),userName,password);
    if(con!=null) System.out.println("Connection Successful!");
    }catch(Exception e){
    e.printStackTrace();
    System.out.println("Error Trace in getConnection() : " + e.getMessage());
    return con;
    Display the driver properties, database details
    public void displayDbProperties(){
    java.sql.DatabaseMetaData dm = null;
    java.sql.ResultSet rs = null;
    try{
    con= this.getConnection();
    if(con!=null){
    dm = con.getMetaData();
    System.out.println("Driver Information");
    System.out.println("\tDriver Name: "+ dm.getDriverName());
    System.out.println("\tDriver Version: "+ dm.getDriverVersion ());
    System.out.println("\nDatabase Information ");
    System.out.println("\tDatabase Name: "+ dm.getDatabaseProductName());
    System.out.println("\tDatabase Version: "+ dm.getDatabaseProductVersion());
    System.out.println("Avalilable Catalogs ");
    rs = dm.getCatalogs();
    while(rs.next()){
    System.out.println("\tcatalog: "+ rs.getString(1));
    rs.close();
    rs = null;
    closeConnection();
    }else System.out.println("Error: No active Connection");
    }catch(Exception e){
    e.printStackTrace();
    dm=null;
    private void closeConnection(){
    try{
    if(con!=null)
    con.close();
    con=null;
    }catch(Exception e){
    e.printStackTrace();
    public static void main(String[] args) throws Exception
    Connect myDbTest = new Connect();
    myDbTest.displayDbProperties();

  • HELP: Can not connect LDAP server with 64bit ldap csdk5.08 on Solaris10

    We are using 64bit ldap csdk5.08 on SunOS5.10. But it doesn't work.
    We wrote a simple client program that connects using ldap_simple_bind_s() function. When I run the code it gives an error saying 'Can't connect to the LDAP server - Connection refused' .
    At the same time using snoop to capture network packages on the ldap server , it shows no package received at all.
    But if we use 32bit ldap library, the program works well and no error is raised.
    And the 64bit ldap tool ldapsearch also works well, it can search data from the server successfully.
    The sample code:
    ==================================================
    #include <ldap.h>
    #include <stdio.h>
    int
    main( int argc, char **argv )
         LDAP *ld;
         int rc;
         /* Get a handle to an LDAP connection. */
         if ( (ld = ldap_init( "150.236.42.53", 38902)) == NULL )
              perror( "ldap_init" );
              return( 1 );
         /* Bind anonymously to the LDAP server. */
         rc = ldap_simple_bind_s( ld, NULL, NULL );
         if ( rc != LDAP_SUCCESS )
              ldap_perror(ld, "ldap_simple_bind_s:");
         return( 1 );
    }

    This looks like a mismatch between C-sdk libraries and Solaris native libraries.
    Are you sure your program loads the correct libraries ?
    Ludovic.

  • "untrusted server cert chain" exception while connecting LDAP server

    While connecting to LDAP server using JNDI over JSSE ..This is happening when trying to get the initial context
    using
    InitialDirContext initContext = new InitialDirContext(env);
    where env is a hash table set with the default parametes.The certificate used for is a Novell CA certificate converted to X509 format and the key store is initialized with this

    This got resolved when in the code the following
    System.setProperty("javax.net.ssl.tmrustStore", CertFileName);
    where cert file name is the filename with complete path.the file is a CA certificate of the LDAP server
    in X509 format

  • Simple example of connecting SAP and VB

    Hi Experts
    Can anyone help me providing material or simple example program of connecting SAP and VB for data transfer.
         Its being a tough task for me, pls help me out.
    Thanks in advance.
    Regards
    Rajaram

    Form VB.NET appliaction you have two ways to connect to SAP system and execute BAPI. Either through webservices or by using NCo. Choice depends upon you appliaction requirement.
    For starting with NCo go through
    http://help.sap.com/saphelp_nw04s/helpdata/en/a9/4a57c1bac80e4e977d8cd9b3ecab89/frameset.htm
    OR
    THIS IS ANOTHER WAY TO LOGIN TO SAP THROUGH VB TRY THIS.
    Logon with the SAPLogon control, Use an RFC call from the SAP Function
    Control, and get the results with the SAP Table Factory Control. . .
    You must have SAPGui's FULL install on your machine for this to work (Or at
    least SAPLogon and the RFC toolkit)
    This VBScript example might help, it calls RFC_READ_TABLE in sap, and emails
    the results back to a user from a selected query (In this case uses that are
    locked out.
    This should show you how this could work in practice.
    Thanks,
    Will
    ' Email Locked out SAP users details to user in a .csv file through MS
    Exchange / CDO
    Dim ctlTableFactory, RFC_READ_TABLE, eQUERY_TAB, tblOptions, tblData,
    tblFields, funcControl, objConnection, ctlLogon
    Set objFileSystemObject = CreateObject("Scripting.FileSystemObject")
    Set ctlLogon = CreateObject("SAP.LogonControl.1")
    Set funcControl = CreateObject("SAP.Functions")
    Set ctlTableFactory = CreateObject("SAP.TableFactory.1")
    Set objWindowsScriptShell = CreateObject("WScript.Shell")
    Set objConnection = ctlLogon.NewConnection
    Set filOutputobjFileSystemObject.CreateTextFile("E:\SAP Scripts\LockedUsers.CSV", True)
    objConnection.ApplicationServerobjWindowsScriptShel l.RegRead("HKLM\Software\AccantiaEDI\SAPServer")
    objConnection.SystemobjWindowsScriptShell.RegRead(" HKLM\Software\AccantiaEDI\SID")
    objConnection.SystemNumber = "00"
    objConnection.ClientobjWindowsScriptShell.RegRead(" HKLM\Software\AccantiaEDI\SAPClient")
    objConnection.Language = "EN"
    objConnection.UserobjWindowsScriptShell.RegRead("HK LM\Software\AccantiaEDI\SAPSAPUser")
    objConnection.PasswordobjWindowsScriptShell.RegRead ("HKLM\Software\AccantiaEDI\SAPSAPPassword")
    booReturn = objConnection.Logon(0, True)
    If booReturn True Then
    'MsgBox " Cannot log on! "
    'MsgBox booReturn
    filOutput.WriteLine "ERROR CALLING LOGGING INTO SAP - FAILED LOGINS
    UNKNOWN"
    Stop
    Else
    'MsgBox " Logon OK."
    funcControl.Connection = objConnection
    Set RFC_READ_TABLE = funcControl.Add("RFC_READ_TABLE")
    Set strExport1 = RFC_READ_TABLE.Exports("QUERY_TABLE")
    Set strExport2 = RFC_READ_TABLE.Exports("DELIMITER")
    Set tblOptions = RFC_READ_TABLE.Tables("OPTIONS") '
    Set tblData = RFC_READ_TABLE.Tables("DATA") '
    Set tblFields = RFC_READ_TABLE.Tables("FIELDS") '
    strExport1.Value = "USR02"
    strExport2.Value = ","
    tblOptions.AppendRow
    tblOptions(1, "TEXT") = "LOCNT > 0 OR UFLAG = 128"
    tblFields.AppendRow
    tblFields(1, "FIELDNAME") = "BNAME"
    tblFields.AppendRow
    tblFields(2, "FIELDNAME") = "LOCNT"
    tblFields.AppendRow
    tblFields(3, "FIELDNAME") = "UFLAG"
    If RFC_READ_TABLE.Call = True Then
    If tblData.RowCount > 0 Then
    filOutput.WriteLine "UserName,FailedLogins,LockedFlag"
    ' MsgBox tblData.RowCount
    For intRow = 1 To tblData.RowCount
    filOutput.WriteLine tblData(intRow, "WA")
    Next
    Else
    filOutput.WriteLine "NO FAILED LOGINS OR LOCKED USERS"
    End If
    Else
    filOutput.WriteLine "ERROR CALLING SAP REMOTE FUNCTION CALL -
    FAILED LOGINS UNKNOWN"
    End If
    End If
    Set filOutput = Nothing
    MailProfile = "MS Exchange Settings"
    Set objSession = CreateObject("MAPI.Session")
    LogonOK = objSession.Logon(MailProfile)
    Set objMessage = objSession.Outbox.Messages.Add
    objMessage.Subject = "SAP Users Report - Locked Users + Failed Logins"
    strSetMessage = "There are " & tblData.RowCount & " users that are
    either locked due to failed logins, or have at least 1 failed login attempt
    on system " & objWindowsScriptShell.RegRead("HKLM\Software\Accant iaEDI\SID")
    & vbcrlf &
    reward if useful

  • When I try to connect LDAP server with Directory certificate installed in Onboard Administrator , I get the below error message. Initiating Directory Settings diagnostic for LDAP server 10.0.0.2 port 636

    10.0.0.2Accepting Directory Server certificate for /CN=qtp-ldap.oaqtp.com signed by /DC=com/DC=oaqtp/CN=qtp-ldap
    Skipping certificate 1 (/CN=qtp-ldap.oaqtp.com): subject issuer mismatch 
    Certificate of Directory Server cannot be verified with the installed LDAP certificate. 
    Unable to establish SSL connection with directory server. 
    You may need to install a certificate for your server to allow SSL connections. 
    It says "Subject Issuer mismatch" .. What could be the reason ?
    -Shibi Keyan

    Well, it sounds like the certificate name is different than what you are trying to connect to. Can you try connecting to the DNS name instead? This sounds like a DNS and Certificate Name issue.
    http://social.technet.microsoft.com/wiki/contents/articles/2980.ldap-over-ssl-ldaps-certificate.aspx
    Kurt Hudson, Sr. Technical Writer AD DS, AD CS, PKI, Azure AD

  • Error while connecting to the LDAP server

    In LDAP Server, i have configured OU with the following characteres.
    OU=Administración.
    Now when i try to connect LDAP server from my application, am getting the following exception.
    [LDAP: error code 49 - 80090308: LdapErr: DSID-0C0903A9, comment: AcceptSecurityContext error, data 52e, v1db0]
    javax.naming.AuthenticationException: [LDAP: error code 49 - 80090308: LdapErr: DSID-0C0903A9, comment: AcceptSecurityContext error, data 52e, v1db0]
         at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3041)
         at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2987)
         at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2789)
         at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2703)
         at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:293)
         at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:175)
         at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:193)
         at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:136)
         at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:66)
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
         at javax.naming.InitialContext.init(InitialContext.java:223)
         at javax.naming.InitialContext.<init>(InitialContext.java:197)
         at javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:82)
    When i search for this, i got the this [link |http://esupport.trendmicro.com/solution/en-us/1037285.aspx/] saying some Accent characters are not converted correctly into 8-bit Unicode Transformation Format (UTF-8).
    Here i have used URLEncoder.encode(mySearchbase, "UTF-8"); to encode the special characters into UTC-8.
    I would like to know whether its a known issue with accent characters or anything else i missed here to handle those characters.
    Thanks,
    -Konanki

    Well, if you're passing an array of bytes to that LDAP access code, then that isn't the right way to encode a String to an array of bytes in UTF-8 encoding. And anyway it's been a long time since I wrote LDAP access code, but I don't recall having to pass arrays of bytes to any of those JNDI classes, so that idea is probably wrong in any case.
    I would suggest, if that page you linked to is actually relevant, that you just install the hot-fix it refers to. On the other hand if it doesn't actually apply to your situation, then you should just ignore it.
    My guess is that UTF-8 or not, your OU value on the server is in fact not "Administraci&oacute;n" -- that's based on the number of mis-encoded characters I see there. So perhaps what you are passing to the JNDI classes does in fact not match the server's value and it isn't an encoding issue at all.

  • Simple Examples on ABAP Objects without using include or function modules

    Hi,
    I am new to ABAP. I need simple example codes on ABAP Objects. It should not have Includes or Function Modules. Just simple codes, using local & global classes, interfaces etc. I searched the forum and even <<the site that shall not be mentioned>>, but did not find a solution. Kindly help please.
    Regards,
    Smruthi.
    Edited by: Matt on Mar 1, 2009 1:20 PM - forbidden site reference removed

    Hello Smruthi
    If you go to the Forum Search and choose the forum ABAP Objects then serach for ZUS_SDN and you will find many of my simple sample reports.
    These reports usually do not contain any includes but they may call function modules which makes perfectly sense. For example, if you are still doing a direct table SELECT instead of using an available BAPI (or class) to get a business object then this is a clear sign of poor (=non-ABAP-OO) programming.
    Regards
      Uwe

  • Simple Server/Client Applet example code ???

    Hi to all.
    I would like to ask if possible to someone to tell me some example code to do this simple thing:
    I want an applet showing only a TextField and a button. When the user writes something on the textfield and press the button, it should send the text in the textfield to the "server", and then it should save it in a variable.
    I think there should be 2 different classes at least (server and client), but no idea in how could I make this on Java.
    So I am asking if possible for some sample code for make this.
    Thank you for the information
    John

    hello!
    Here is a console based Server which will recieve the string and disply on the DOS screen.
    /////////////////////////////////// Server /////////////////
    import java.net.*;
    import java.io.*;
    import java.util.*;
    public class ChatServer extends Thread
    ServerSocket ssSocket;
    Socket sSocket;
    public BufferedReader in;
    public PrintWriter out;
    public ChatServer()
         try
         ssSocket = new ServerSocket (4000);
         catch(IOException e)
         System.out.println (e);
    public void run()
    try
         sSocket = ssSocket.accept();
         if(sSocket != null)
              in = new BufferedReader(new InputStreamReader(sSocket.getInputStream()));
              out = new PrintWriter(sSocket.getOutputStream(), true);
    String str = in.readLine();
         System.out.println (str);
         catch(IOException e)
              System.out.println (e);
    public static void main (String []args)
              Thread th = (Thread) new ChatServer();
              th.start();     
    ///////////////////////// Client //////////////////////
    public class Client extends Applet implements ActionListener
    public Socket sClient;
    public BufferedReader in;
    public PrintWriter out ;
    String str;
    private TextField txt = new TextField();
    private Button btn = new Button ("OK");
    public void init()
         try
         sClient = new Socket ("localhost" , 4000);
         in = new BufferedReader(new InputStreamReader(sClient.getInputStream()));
         out = new PrintWriter(sClient.getOutputStream(), true);
         catch (UnknownHostException uhe)
         catch (IOException ioe)
         System.out.println (" I/O Exception : " + ioe);
         setLayout(new FlowLayout());
         txt.setColumns (20);
         add(txt);
         add(btn);
         btn.addActionListener(this);
    public void actionPerformed(ActionEvent AE)
         if(AE.getSource() == btn)
         str = txt.getText();
         out.println(str);
    now u should try it and improve it according to ur need...
    Ahmad Jamal.

  • Connect to open ldap server using ODI

    Hello,
    I need to use openldap as dataserver in ODI. But I'm not sure how to provide valid connection string. My test ldap server:
    - host: 172.18.0.106
    - port: 389
    - base dn: dc=example,dc=com
    And (optionally), root access (simple authentication):
    - Bind dn: cn=jimbob, dc=example, dc=com
    - password: pass
    So, I'm trying to begin with anonymous access (read only), this is my connection string:
    jdbc:snps:ldap?ldap_url=ldap://localhost:389/&ldap_basedn='dc=example,dc=com'
    Unfortunatelly, it does now work:
    java.sql.SQLException: ODI-40528: A com.sunopsis.ldap.connection.SnpsLdapDriverPropertyException occurred saying: ODI-40546: A user has not been provided
    Why does it ask me for user? ODI documentation says, that user/pass are not mandatory.
    What are correct connection strings for anonymous access and root (or other user) access in my case? Both methods works with apache directory studio.

    You can set ldap_auth=none for anonymous user.
    User/password is mandatory otherwise. Please refer to http://docs.oracle.com/cd/E21764_01/integrate.1111/e12644/appendix_ldap_driver.htm#CHDHCABH
    Thansk,

  • How to connect a LDAP Server?

    When creating the LDAP Data Server in Topology Manager using the Sunopsis LDAP Open Connector, the following message is displayed:
    "A NamingException occured saying: [LDAP: error code 49 - Invalid Credentials]"
    I use the sunopsis JDBC driver:
    com.sunopsis.ldap.jdbc.driver.SnpsLdapDriver
    and set the parameters:
    jdbc:snps:ldap?ldap_url=ldap://10.182.255.38:389/&ldap_basedn=cn=Users,dc=cn,dc=oracle,dc=com
    the user is set to:
    cn=orcladmin,cn=Users,dc=cn,dc=oracle,dc=com OR cn=orcladmin OR orcladmin, the error is the same.
    Could anyone tell me how to solve this issue?

    I can't connect to the ldap server.
    Using a simple java program, no problem, ODI, no go.
    Some code I found on the internet to connect to the ldap server
    Note the comments on SECURITY_PRINCIPAL and SECURITY_CREDENTIALS.
    This works fine for me.
    If I try to do the same with ODI, it doesn't work.
    Why?
    Kinde regards,
    Frans.
    public static void main( String[] args ) {
    // set up environment to access the server
    Properties env = new Properties();
    env.put( Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory" );
    env.put( Context.PROVIDER_URL, "ldap://" + ldapServerName + "/" + rootContext);
    //env.put( Context.SECURITY_PRINCIPAL, rootdn );
    //env.put( Context.SECURITY_CREDENTIALS, rootpass );
    try {
    // obtain initial directory context using the environment
    DirContext ctx = new InitialDirContext( env );
    // now, create the root context, which is just a subcontext
    // of this initial directory context.
    //ctx.createSubcontext( rootContext );
    Attributes attr = ctx.getAttributes("");
    NamingEnumeration allAttr = attr.getAll();
    while (allAttr.hasMore()) {
    Attribute a = (Attribute)allAttr.next();
    System.out.println("attr: " + a.getID());
    NamingEnumeration values = attr.getAll();
    while (values.hasMore()) {
    System.out.println("value: " + values.next());
    catch ( NameAlreadyBoundException nabe ) {
    System.err.println( rootContext + " has already been bound!" );
    catch ( Exception e ) {
    System.err.println( e );
    }

  • Sample connecting to LDAP Server in Java

    Hi,
    I am trying to establishing SSL from Java Application(via Netscape Directory SDK 4.0 - Java version) to the Directory Server(ADS) in a secure manner - i.e. LDAP over SSL.
    I am trying to run this code...
    LDAPConnection ld = null;
    LDAPModificationSet attrs = new LDAPModificationSet();
    attrs.add(LDAPModification.REPLACE,new LDAPAttribute("unicodePwd", "testpassword"));
    try
    LDAPSSLSocketFactory ssl = new LDAPSSLSocketFactory();
    ld = new LDAPConnection( ssl );
    /* Connect to server */
    ld.connect("10.10.10.7",636);
    /* Authenticate to the server as directory manager */
    ld.authenticate(adminDN,password);
    /* Now modify the entry in the directory */
    ld.modify( userDN, attrs );
    catch(Exception e)
    But I don't know where my program reads the Cert. info... I don't know
    if I have to import my internal CA via keytool or I have missed some
    special configuration ..
    When I run this code, the following error appears:
    netscape.ldap.LDAPException: Failed to create SSL socket (91); Cannot connect to the LDAP server
    at netscape.ldap.LDAPSSLSocketFactory.makeSocket(LDAPSSLSocketFactory.java:309)
    at edu.umassmed.chcf.security.ldap.LDAPHelper.setLDAPPassword(LDAPHelper.java:742)
    at edu.umassmed.chcf.security.administration.userhandler.UserHandlerBean.changePassword(User HandlerBean.java:628)
    at edu.umassmed.chcf.security.administration.userhandler.UserHandlerBean_37ncs1_ELOImpl.chan
    gePassword(UserHandlerBean_37ncs1_ELOImpl.java:409)
    at edu.umassmed.chcf.security.administration.userfacade.UserManagerBean.changePassword(UserM
    anagerBean.java:174)
    at edu.umassmed.chcf.security.administration.userfacade.UserManagerBean_3chmth_EOImpl.change
    Password(UserManagerBean_3chmth_EOImpl.java:501)
    at edu.umassmed.chcf.sbb.action.ChangePasswordAction.perform(ChangePasswordAction.java:114)
    at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1787)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1586)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:24
    95)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2204)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    LDAPHelper - authenticateUser() - expLDAP.toString() netscape.ldap.LDAPException: Failed to create S
    SL socket (91); Cannot connect to the LDAP server
    Is this possible? If so, what hints can you give me to get started (any sample code would be greatly appreciated).
    Thanks in advance.
    With Regards,
    Gokul.

    hey guys .. i was struggling with the same thing - finally found this solution -
    use:
    import netscape.ldap.*;
    import netscape.ldap.factory.JSSESocketFactory;
    JSSESocketFactory fact = new JSSESocketFactory(null);
    //unless u wanna specify any specific ciphers in the constructor
    log("Factory created");
    LDAPConnection ld = new LDAPConnection(fact);
    log("Connection initialised");
    ld.connect(MY_HOST, MY_PORT);
    log("Connected");
    ld.authenticate(user, pwd);
    log("Authenticated!");
    Before running this, i used the "keytool" command line utility to import the SSL client certificate into my default trustStore .. as a trusted cert. Dont know if thats required.. but it worked :) Hope this helps.

  • HTTP Error Code 500 Internal Server Error creating connection

    Hi, i have an error when i try to create a database connection
    i have windows 7
    php 5
    mysql 5
    if i try to connect to mysql with a icode i gererate it connects perfect.
    if i use for example ems mysql manager it connects perfect to the databases
    but when i try to create a connection in dreamweaver it appears:
    HTTP Error Code 500 Internal Server Error
    i dont know what to do.
    i have done a lot of steps for solve other errors:
    - chance mysql passwords for old_password
    - remove cache file
    any idea ??
    thanks.

    I would look at your log files on your server to see what is the issue.
    You most likely will have a php error log and a server error log.  That will point you in the right direction.

  • How to determine the error code, returned from LDAP server

    I use the next code for connect to LDAP server:
            try{
                ctx = new InitialLdapContext(env, null);
                 //if connection successfull ...
            } catch (NamingException){
                 //if error occured ...
            }Is it possible to determine the numeric error code, returned from server?

    I was just working on using openldap, binding to it and checking for expired passwords and locked accounts and it looks like that an AuthenticationException is thrown in these circumstances and the ctx is null so it is not possible process connection response controls. But you can look at operation attributes if you have password policy enabled and you are looking for these type of errors

Maybe you are looking for

  • No longer able to add account

    The last 2 weeks my Macbook no longer recognises any "alien" accounts. It started with mail no longer accepting my gmail and hotmail accounts and constantly asking for the passwords and rejecting them even though I'm 100% sure I used the right passwo

  • Problem after installing windows 8.1-THREAD_STUCK_IN_DEVICE_DRIVER

    After installing Windows 8.1 in my Dell inspiron 15r SE, i have been noticing that before starting up every time it shows "an error occurred THREAD_STUCK_IN_DEVICE_DRIVER check online for updates....... 

  • CP5 - import function is always greyed out

    Hi all, the function that lets you import frames and captions from other projects (in the "File" menu) is always greyed out. I can open parallel projects and do a copy & paste, but I never had problems using this feature in previous releases. Maybe I

  • Cropping to an edge confuses Adobe Bridge?

    I use Abobe Bridge as the host application for Camera Raw. For me, it makes much more sense than hunting for images from Photoshop. I think it's been at least three years-probably longer-since I noticed that Bridge has a habit of extracting some prev

  • Message question

    The local TV station sends news and weather updates to my iphone3G.  How can I stop this?