Java JNDI Search method performance

Hi,
My requirement is i have more than 10 unique values for single a attribute. i need to retrieve all 10 records mathing it from LDAP using Java JNDI. But in LDAP there are more than 100 unique record in LDAP i need only 10 record that mathes my values.
For example the attribute ou in LDAP has 10 unique values. the values could be retrieved in two ways
Method one: Single Search
I could use a single search to LDAP with all the 10 values in filters
and retrieve all the value
Ex:
String filter = "(|(ou=1)(ou=2)(ou=3)(ou=4)(ou=5)(ou=6)(ou=7)(ou=8)(ou=9)(ou=10))";
NamingEnumeration answer = ctx.search(BASE_SEARCH, filter, ctls);
Method Two: Multiple Search
I could use a multiple search to LDAP for each value of ou
Ex:
String[] inputou ={"ou=1","ou=2","ou=3","ou=4","ou=5","ou=6","ou=7","ou=8","ou=9","ou=10"};
int inputSize=inputou.length;
for (int j=0;j<inputSize;j++){
Attributes matchattribs = new BasicAttributes(true);
matchattribs.put(new BasicAttribute("ou", inputou[j]));
NamingEnumeration answer2 = ctx.search(BASE_SEARCH,
               matchattribs, returnAttrs);
Query:
which method is more efficient single search or multiple search.
is it efficient to have mutiple search based on one specific ou or it is efficient to have single search with multiple ou using OR clause.
is it less efficient when executing an OR clause and searching with multiple ou.
Thanks

Hi,
They are equivalent becuase second method does not use a filter and for each iteration it creates new mathcing attributtes and executed the search to LDAP. My query is in method one the number of hit to LDAP is one in second method the number of hit to LDAP is 10 based on the number of ou.
I have checked this program and tracked through System.currentTimeMillis() using more than 1000 ou's. the time taken for method one is 3.2306666 mins and the time taken for method two is 4.61735. so it is clear that method one is more efficient in terms of time but still i need more detail answer because some say using OR clause in filter is less efficient than using ou=1.
Thanks

Similar Messages

  • Error:java.lang.Double:method parseDouble(Ljava/lang/String;)D not found.

    Hi ,
    oracle apps version : 11.5.10.2 and database version 11.2.0.2.
    OS version Solaris Sparc 64 Bit.
    We were performing a cloing activity on a new server and now while opening forms we are getting the following error :
    error:java.lang.Double:method parseDouble(Ljava/lang/String;)D not found.Please suggest what has to be done.
    Regards
    Kk

    Hi ,
    D:\Documents and Settings\800045916>java -version
    java version "1.6.0_29"
    Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
    Java HotSpot(TM) Client VM (build 20.4-b02, mixed mode, sharing)We have been struggling with the Solaris server for this. Is something needed from there also or just need to have the latest JRE in the windows client machine.
    Regards
    Kk

  • Using java.lang.reflect.Method.invoke on a static method?

    This is probably a FAQ, but I am finding it impossible to construct a search which answers this question for me.
    How do I call java.lang.reflect.Method.invoke on a static (e.g. class) method? Is it even possible?
    Thanks,
    dwh

    Is this of any help?
    http://www.esus.com/javaindex/j2se/jdk1.2/javalang/reflection/reflection.html
    Cheers,
    Joris

  • Problem with search method in AM called from JSP

    Hi, im trying to get the real value from an foreign key of a view, and i have been created a custom search method in the AM, but i got a problem, the search only get results the first time that is called, the next times gets null result :
    public String getValorReal(Long identificador, String vista,
    String campoFiltro, String campoValor)
    where identificador is the foreign key, vista is the name of the view that contains the real value of the foreign key, campoFiltro is the field name of the view that will match the foreign key, and campoValor is the field name of the view that the search method will return as the real value.
    I created this class that call the search method :
    public class CuentasContablesOrgLOV {
    private BindingContainer bindings;
    public Map CuentaContable= new HashMap(){
    public Object get(Object key){
    Map parametros;
    BindingContainer bindings = getBindings();
    String result = null;
    OperationBinding operationBinding = bindings.
    getOperationBinding("getValorReal");
    if (operationBinding != null){
    parametros = operationBinding.getParamsMap();
    parametros.put("identificador",new Long(key.toString()));
    parametros.put("vista","CcCuentasContablesView4");
    parametros.put("campoFiltro","identificador");
    parametros.put("campoValor","CuentaContable");
    result = (String)operationBinding.execute();
    return result;
    public Map getCuentaContable() {
    return CuentaContable;
    I invoke this class from the JSP with EL:
    <af:outputText value='#{CuentasContablesOrgLOV.cuentaContable[row.CcCucoIdentificador]}'/>
    In the AM method obtains all the parameters correct, but the search only works the first time!
    Do you have an idea whats been happened?
    thanks a lot for your help

    There is no <%@ method %> tag for a JSP.
    http://java.sun.com/products/jsp/syntax/1.2/syntaxref12.html
    It looks like you are trying to write a JSP that only accepts post requests - not get?
    I'm not sure if you can accomplish that in a JSP directly.
    You can with an HttpServlet (which is where the doGet/doPost methods are defined) but HttpJspPage doesn't extend that class necessarily.
    Best you could probably do is put in a test of request.getMethod() to see if it is get/post.

  • Best native search method

    What is the Best native search method in Java? Is it Merge Sort implemented in Collections.sort()?

    > Okay. So just list all the methods that ARE in the
    Java API and only look for those methods in the
    documents that were linked to.
    Thanks, Paul. I guess I assumed that was blazingly obvious. I appreciate the clarification... :o)
    ~

  • Search method problem

    Hi again,
    I have problems about my search method at the below. It always create ArrayIndexOutOfBounds Exception. According to this error, the index(38) equals to the size of my arraylist. So how can I fix it ??
    import java.util.*;
    * ...Listdescription...
    * @author  ...yourname...
    * @version 1.00, 2006/05/19
    public class List
         // properties
         ArrayList store;
         int index = 0;
         // constructors
         public List(){
              store = new ArrayList();
         // methods
         public void add(Object e,int node){
              store.add(node, e);
         public void addHead(Object e){
              store.add(0, e);
         public void addTail(Object e){
              store.add(e);
         // recursive method     
         public void toString(int a){
              if(store.size() == a )
                   System.out.println( "");
              else{
                   System.out.println(store.get(a));
                   toString(a + 1);
         // recursive method
         public int search(Object e){
    //          if(index == store.size())
    //               return -1;
              if(e == store.get(index)){
                   return store.indexOf(e);
              else{
                   index++;               
                   return search(e);               
         public static void main( String[] args)
                 List myList = new List();
                 for(int a = 0; a < 35; a++ )
                      myList.add(a,new Integer(a));
                 myList.add(35,new Integer(35));
                 myList.addHead(new Integer(36));
                 myList.addTail(new Integer(39));
                 myList.toString(0);
                 System.out.println(myList.search(new Integer(3)));
    } // end of class List

    Do you think that the following can run for all object types ?
         public int search(Object e){
              if(index == store.size())
                   return -1;
              if(e.equals(store.get(index))){
                   return store.indexOf(e);
              else{
                   index++;               
                   return search(e);               
         }

  • JNDI Search Problems

    I am doing a JNDI search then looping through the results using code with the following fragment. The problem is the my search is not listing all the possible results. My search filter is a simple (uid=*). My JAVA application comes back with 63 results while a similar Pearl application comes up with 594 results. Does anyone have any suggestions as to what I might look for. The 63 results that are sent back by JAVA are identical to the first 63 results sent back by Pearl. No errors are being caught/reported.
    Thanks,
    Dustin
    while (results != null && results.hasMore())
    SearchResult sr = (SearchResult) results.next();
    String dn = sr.getName();
    out.println(dn + "\t");

    Hi Dustin
    I am not getting user list from ADS using ldap query.Please help me
    Thanking you
    Best regards
    Manoj
    [email protected]

  • Error while opening a dwg file :java.lang.NoSuchMethodException: Method

    Hello Experts,
    I tried to integrate WebCenter Content with Autovue ,the integration was good untill i get this error while trying to open a dwg file checked in Content Server using View in Autovue option in Actions :
    java.lang.NoSuchMethodException: Method fileOpen(com.cimmetry.core.SessionID, com.cimmetry.core.DocID, com.cimmetry.core.Authorization, <null>, java.lang.Boolean, <null>) not found in class com.cimmetry.jvueserver.VCETConnection
         at com.cimmetry.jvueserver.ar.a(Unknown Source)
         at com.cimmetry.jvueserver.ar.a(Unknown Source)
         at com.cimmetry.jvueserver.ar.a(Unknown Source)
         at com.cimmetry.jvueserver.ar.d(Unknown Source)
         at com.cimmetry.jvueserver.ar.a(Unknown Source)
         at com.cimmetry.jvueserver.ah.run(Unknown Source)
    Any suggestions would help me,
    Thanks in Advance
    Raj

    Hi Raj,
    The solution to this problem is posted in My Oracle Support:
    Error: "java.lang.NoSuchMethodException: Method fileOpen" when Trying to View Files Using AutoVue Integrated to Oracle Universal Content Management (UCM) (Doc ID 1341644.1).
    It has all the details, step by step.
    Jeff

  • How do i get a list of all Roles defubed under a particular OrganizationalUnit? How can i use LDAPConnection.search method for this?

     

    Sorry for the typographical mistake.
    Please read the question as:"How do i get a list of all Roles defined under a particular OrganizationalUnit? How can i use LDAPConnection.search method for this?"

  • Java.sql.Blob method setBinaryStream?

    Hi,
    I've been trying to use the java.sql.Blob methods instead of the "Oracle Extensions" so that people w/o Oracle (using MySQL etc.) can still use my code.
    Problem: trying to get the OutputStream to write to the Blob. As of JDK1.4, java.sql.Blob has a method to do this, setBinaryStream. Unfortunately, calling this in Oracle JDBC (tried it in both thin and OCI version) throws an SQLException (Unsupported feature).
    Sample code:
    //Assume we already have a connection to the database, over either OCI or thin.
    //Assume a Statement stmt created from the connection.
    //Assume a table BlobTable with 2 fields : id (number) and data (blob).
    public void uploadBlob(byte [] theBytes){
         try{
         stmt.executeUpdate("INSERT INTO BlobTable (id, data) VALUES (1,empty_blob())");
         ResultSet rs = stmt.executeQuery("SELECT data FROM BlobTable WHERE id=1 FOR UPDATE");
         if (rs.next()){
    java.sql.Blob blob=rs.getBlob(1);
         OutputStream out=blob.setBinaryStream(0);
         //Next line never printed - error thrown.
         System.out.println("Got Stream");
         catch(Exception e){e.printStackTrace();}
    //End code
    Am I doing something wrong? Or is there simply no way to write to a Blob without using the extensions?
    None of the docs (examples, guides, etc) make any mention of this, although the JDBC dev guide does mention that the similar method in PreparedStmt only works over OCI.
    Thanks,
    Dan

    Hi lancea,
    It's been a while since this thread was active, but I have a related question.
    Is there a comprehensive list of changes between JDBC 3 and JDBC 4 that makes application not work any more, such as this setBinaryStream issue or the CallableStatement/Named parameters issue that we stumbled upon. We would like to address these issues proactively and not find out about them in production, since we're upgrading from jdk1.4 to jdk6. Oracle has provided us with their changes regarding database versions, but have been less forthcoming with JDBC spec version changes.
    Thanks in advance,
    Thomas Auzinger

  • Java.lang.NoSuchMethodError: java.lang.Float: method parseFloat(Ljava/lang/

    java.lang.NoSuchMethodError: java.lang.Float: method parseFloat(Ljava/lang/String;)F not found
    WHAT WOULD MAKE THIS HAPPEN. THIS SEEMS TO WORK IN JDK1.3.1 BUT NOT IN BLACKDOWN 1.1.3_V3
    THIS IS MY CODE:
    try{
    DecimalFormat dfp = new DecimalFormat( "0.00" );
    if(!Price.equals("")) {
    float MyFloat = Float.parseFloat(Price);
    Price = dfp.format(MyFloat);
    }catch(NumberFormatException nfe){
    PriceValid = 1;

    This error says:
    - There is no method called "parseFloat" that receives a String as parameter in class java.lang.Float.
    Look the method "parseFloat" at the class java.lang.Float!!

  • How can we call java control source methods within jsp

    Hi guys!
              How can we access java control source methods that are defined in java control projects within jsp.I am getting error when I tried to call java control source's methods in scriptlet of JSP page.Any help/suggestion is appreciated.
              Thanks
              -Chandu

    Uh, what?
    (And you are sure that it's not a Weblogic-specific question?)

  • Java.lang.UnsupportedOperationException: Method not yet implemented

    Hi
    I work on a project that use java api version 1.2, after the deployment of the web application and using it I have had the following error message:
    [Mon Oct 16 11:52:51 GMT 2006] Memory used: 24467288 Error: org.epoline.soprano.Csstart: A fatal error occured in SOPRANO: Method not yet implemented : java.lang.UnsupportedOperationException: Method not yet implemented
         at javax.mail.internet.MimeBodyPart.setFileName(MimeBodyPart.java:156)
    here is the code:
    // attach the file to the message
    FileDataSource fds = new FileDataSource(fileName);
    attach.setDataHandler(new DataHandler(fds));
    attach.setFileName(fds.getName());
    it sseems that the method setFileName of MimeBodyPart class throw the exception. I tried to change the jar to version 1.3.3 or 1.4 but nothing change. Can you help me. Thanks

    here is the Exception stack trace:
    [Tue Nov 07 11:57:01 GMT 2006] Memory used: 43627528 Error: org.epoline.soprano.Csstart: A fatal error occured in SOPRANO: Method not yet implemented : java.lang.UnsupportedOperationException: Method not yet implemented
         at javax.mail.internet.MimeBodyPart.setFileName(MimeBodyPart.java:156)
         at org.epoline.soprano.container.xmlOutput.LstXmlOutput.sendResultByMail(LstXmlOutput.java:812)
         at org.epoline.soprano.xmlOutput.XmlOutput.doSendResultByMail(XmlOutput.java:437)
         at org.epoline.soprano.xmlOutput.XmlOutput.doValid(XmlOutput.java:87)
         at org.epoline.soprano.share.CsServlet.doIt(CsServlet.java:475)
         at org.epoline.soprano.share.CsServlet.doWork(CsServlet.java:857)
         at org.epoline.soprano.share.CsServlet.doPost(CsServlet.java:685)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:419)
         at org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.java:169)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.epoline.soprano.hibernate.HibernateFilter.doFilter(HibernateFilter.java:39)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Thread.java:534)
    I'm using tomcat version 5.0.30, I don't know where to go next.
    thanks

  • Call Java Class and Methods from ABAP

    Hi
    I install de JCo, But how i can call java class and methods from ABAP?. somebody has an example?
    The tutorial say that's is possible,  but don't explain how do that?
    Thanks.
    Angel G. Hurtado

    If you need only simple java program, you do not need to install JCo. The following codes can call java class.
    DATA: COMMAND TYPE STRING VALUE 'C:\j2sdk1.4.2_08\bin\java',
          DIR TYPE STRING VALUE D:\eclipse\workspace',
          PARAMETER TYPE STRING VALUE 'Helloworld'. "here the name of your java program
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE
       EXPORTING
         APPLICATION = COMMAND
         PARAMETER = PARAMETER
         DEFAULT_DIRECTORY = DIR
       MAXIMIZED =
         MINIMIZED = 'X'     "If you need the DOS window to be minimized
      EXCEPTIONS
        CNTL_ERROR = 1
        ERROR_NO_GUI = 2
        BAD_PARAMETER = 3
        FILE_NOT_FOUND = 4
        PATH_NOT_FOUND = 5
        FILE_EXTENSION_UNKNOWN = 6
        ERROR_EXECUTE_FAILED = 7
        OTHERS = 8.
    Tell me if it works.
    Nuno.

  • Search Method

    Dear all,
    I am working in ADF 10g (I have a problem when I am creating Search method).
    I need to make search by using LOV (create 2 LOV list one for month and one for Year)
    In my DB I have the the date in one column (19-Feb-2009)
    I make two view object one for month and I use this statement:
    SELECT Distinct TO_CHAR(A_DATE,'Month'),EXTRACT(Month from A_DATE)
    from Attendances
    order by EXTRACT(Month from A_DATE) ASC
    Because I need to extract the month from the date column(EXTRACT(Month from A_DATE) as a text(TO_CHAR(A_DATE,'Month') and distinct( Distinct TO_CHAR(A_DATE,'Month').
    for the year I used this statement:
    Select Distinct EXTRACT(YEAR from A_DATE)
    from Attendances
    order by EXTRACT(YEAR from A_DATE) ASC
    in the Application Data Module I got this:
    In the Date:
    TOCharADateMonth
    ExtractMonthfromDate
    In the year
    ExtractYearfromDate
    The Method I used:
    public void SearchYear(String Year, String Month) {
    ArchiveVOImpl view = getArchiveVO1(); // To get Archive view
    ViewCriteria vc = view.createViewCriteria(); //
    ViewCriteriaRow vcr = vc.createViewCriteriaRow();
    ViewCriteriaRow mon = vc.createViewCriteriaRow();
    if (Year != null || Month != null) {
    vcr.setAttribute("ADate", Year);
    mon.setAttribute("ADate", Month);
    vcr.setUpperColumns(true);
    mon.setUpperColumns(true);
    vc.add(vcr);
    vc.add(mon);
    view.applyViewCriteria(vc);
    view.executeQuery();
    I have the error from Date format
    I need the help in this, cause this is first time to me to use ADF.

    Where should I use this
    view.setWhereClause("WHERE TO_CHAR(ADATE,'YYYY') = '" + Year + "'");
    could you explain to me?
    Did I need to change any statements?
    Edited by: user807547 on Aug 31, 2009 1:35 AM
    Edited by: user807547 on Aug 31, 2009 1:36 AM

Maybe you are looking for

  • How do I reducing the amount of joining when using one-to-one mappings?

    Examine the following example; class Person Address address; String firstName, lastName; class Address Long addressId; String state, city, zip; Assume that both of these classes are mapped to tables in a database. Attributes such as Staff's name and

  • How can i get deleted contacts back on my phone

    Some of my contacts got deleted off my iphone 4s, how can I retrieve them?

  • Best Practice for validating radio buttons

    Hi, I'm building a form which has quite a lot of questions that a user answers my selecting a radio button. All the questions are required. Could someone please advise me what the best practice is for validating a radio button in a radio button group

  • Import and export module pool

    Hi all, I need to import the module pool or dialogprogram and then export it to another . say from sand box to dev . I cannot do it through transports . I need to transfer everything including the screens. Any help would be greatly appreciated. Thank

  • P2MP design

    I am in the process of designing a Wireless solution to connect 2 separate buildings that are hard to wire. In the design, I have a central building that will home all of the networking devices including, wireless bridge, and the gateway. This is the