Problem in using PARTITION BY with SCORE

Hi
I have a table in which I have list of products along with the name of the company that offers that product. Table structure is as shown below:
PRD_ID NUMBER
PRD_NAME VARCHAR2(100)
COMPANY_NAME VARCHAR2(100)
PRD_DESC VARCHAR2(500)
DUMMY CHAR(1)
I have created an Intermedia Index on PRD_NAME and PRD_DESC with
PRD_NAME and PRD_DESC as two separate field sections.
Now I want to retrieve up-to 3 products per company that match the searched keywords. Now if a user searches for Candle Holders then I write following query
SELECT A.*, ROWNUM FROM
(SELECT SCORE(1) AS SC,
PRD_ID,
     PRD_NAME,
     COMPANY_NAME,
     ROW_NUMBER() OVER (PARTITION BY COMPANY_NAME ORDER BY SCORE(1) DESC) AS RK
FROM PRODUCTS
WHERE CONTAINS(DUMMY,'(Candle Holders)*7, ($Candle $Holders)*5, (Candle% Holders%)*3) within PRD_NAME)'
,1) > 0 ) A
WHERE A.RK <= 3
ORDER BY A.COMPANY_NAME, SC DESC;
I have many records in my database that should get a score of 100 in the above query - e.g.
Glass Candle Holder Comp1
Iron Candle Holder Comp1
Metal Candle Holder Comp2
Votive Candle Holder Comp3
Silver Plated Candle Holder Comp4
Gold Plated Candle Holder Comp4
Copper Plated Candle Holder Comp4
Platinum Coated Candle Holder Comp4
and so on.
My query is returning upto 3 records per company, but it is not giving 100 as score.
If I remove the row_number() partition by clause, then my query returns 100 score.
I want to restrict the query from returning product at a certain cut-off score.
Please advise what is wrong in the above query and what can I do to fix the problem
Regards
Madhup

I am unable to reproduce the problem given only what you have provided. I get the same score no matter what. What version of Oracle are you using? The only thing I can think of is to put the query without the row_number in an inline view and add a condition where rownum > 0 to try to materialize the view, then apply your row_number in an outer query, as in the last query in the example below.
SCOTT@10gXE> CREATE TABLE products
  2    (PRD_ID           NUMBER,
  3       PRD_NAME      VARCHAR2(100),
  4       COMPANY_NAME  VARCHAR2(100),
  5       PRD_DESC      VARCHAR2(500),
  6       DUMMY           CHAR(1)
  7  )
  8  /
Table created.
SCOTT@10gXE> INSERT ALL
  2  INTO PRODUCTS VALUES (1, 'Glass Candle Holder', 'Comp1', NULL, NULL)
  3  INTO PRODUCTS VALUES (2, 'Iron Candle Holder', 'Comp1', NULL, NULL)
  4  INTO PRODUCTS VALUES (3, 'Metal Candle Holder', 'Comp2', NULL, NULL)
  5  INTO PRODUCTS VALUES (4, 'Votive Candle Holder', 'Comp3', NULL, NULL)
  6  INTO PRODUCTS VALUES (5, 'Silver Plated Candle Holder', 'Comp4', NULL, NULL)
  7  INTO PRODUCTS VALUES (6, 'Gold Plated Candle Holder', 'Comp4', NULL, NULL)
  8  INTO PRODUCTS VALUES (7, 'Copper Plated Candle Holder', 'Comp4', NULL, NULL)
  9  INTO PRODUCTS VALUES (8, 'Platinum Coated Candle Holder', 'Comp4', NULL, NULL)
10  SELECT * FROM DUAL
11  /
8 rows created.
SCOTT@10gXE> BEGIN
  2    FOR i IN 1 .. 10 LOOP
  3        INSERT INTO products (prd_id, prd_name, company_name)
  4        SELECT object_id, object_name, 'Comp1' FROM all_objects;
  5    END LOOP;
  6  END;
  7  /
PL/SQL procedure successfully completed.
SCOTT@10gXE> COMMIT
  2  /
Commit complete.
SCOTT@10gXE> EXEC CTX_DDL.CREATE_PREFERENCE ('your_multi', 'MULTI_COLUMN_DATASTORE')
PL/SQL procedure successfully completed.
SCOTT@10gXE> BEGIN
  2    CTX_DDL.SET_ATTRIBUTE ('your_multi', 'COLUMNS', 'PRD_DESC, PRD_NAME');
  3  END;
  4  /
PL/SQL procedure successfully completed.
SCOTT@10gXE> EXEC CTX_DDL.CREATE_SECTION_GROUP ('your_sec_group', 'BASIC_SECTION_GROUP')
PL/SQL procedure successfully completed.
SCOTT@10gXE> BEGIN
  2    CTX_DDL.ADD_FIELD_SECTION ('your_sec_group', 'PRD_DESC', 'PRD_DESC', TRUE);
  3    CTX_DDL.ADD_FIELD_SECTION ('your_sec_group', 'PRD_NAME', 'PRD_NAME', TRUE);
  4  END;
  5  /
PL/SQL procedure successfully completed.
SCOTT@10gXE> CREATE INDEX your_index ON products (dummy)
  2  INDEXTYPE IS CTXSYS.CONTEXT
  3  PARAMETERS
  4    ('DATASTORE     your_multi
  5        SECTION GROUP your_sec_group')
  6  /
Index created.
SCOTT@10gXE> EXEC DBMS_STATS.GATHER_TABLE_STATS ('SCOTT', 'PRODUCTS')
PL/SQL procedure successfully completed.
SCOTT@10gXE>
SCOTT@10gXE> COLUMN prd_name      FORMAT A30
SCOTT@10gXE> COLUMN company_name FORMAT A10
SCOTT@10gXE> COLUMN prd_desc      FORMAT A8
SCOTT@10gXE> SELECT A.*, ROWNUM FROM
  2  (SELECT SCORE(1) AS SC,
  3  PRD_ID,
  4  PRD_NAME,
  5  COMPANY_NAME,
  6  ROW_NUMBER() OVER (PARTITION BY COMPANY_NAME ORDER BY SCORE(1) DESC) AS RK
  7  FROM PRODUCTS
  8  WHERE CONTAINS(DUMMY,'(((Candle Holders)*7, ($Candle $Holders)*5, (Candle% Holders%)*3) within PRD_NAME)'
  9  ,1) > 0 ) A
10  WHERE A.RK <= 3
11  ORDER BY A.COMPANY_NAME, SC DESC
12  /
        SC     PRD_ID PRD_NAME                       COMPANY_NA         RK     ROWNUM
        28          1 Glass Candle Holder            Comp1               1          1
        28          2 Iron Candle Holder             Comp1               2          2
        28          3 Metal Candle Holder            Comp2               1          3
        28          4 Votive Candle Holder           Comp3               1          4
        28          8 Platinum Coated Candle Holder  Comp4               1          5
        28          7 Copper Plated Candle Holder    Comp4               2          6
        28          6 Gold Plated Candle Holder      Comp4               3          7
7 rows selected.
SCOTT@10gXE> SELECT A.*, ROWNUM FROM
  2  (SELECT SCORE(1) AS SC,
  3  PRD_ID,
  4  PRD_NAME,
  5  COMPANY_NAME
  6  FROM PRODUCTS
  7  WHERE CONTAINS(DUMMY,'(((Candle Holders)*7, ($Candle $Holders)*5, (Candle% Holders%)*3) within PRD_NAME)'
  8  ,1) > 0 ) A
  9  ORDER BY A.COMPANY_NAME, SC DESC
10  /
        SC     PRD_ID PRD_NAME                       COMPANY_NA     ROWNUM
        28          1 Glass Candle Holder            Comp1               1
        28          2 Iron Candle Holder             Comp1               2
        28          3 Metal Candle Holder            Comp2               3
        28          4 Votive Candle Holder           Comp3               4
        28          5 Silver Plated Candle Holder    Comp4               5
        28          6 Gold Plated Candle Holder      Comp4               6
        28          7 Copper Plated Candle Holder    Comp4               7
        28          8 Platinum Coated Candle Holder  Comp4               8
8 rows selected.
SCOTT@10gXE> SELECT SCORE(1) AS SC,
  2           PRD_ID,
  3           PRD_NAME,
  4           COMPANY_NAME
  5  FROM   PRODUCTS
  6  WHERE  CONTAINS
  7             (DUMMY,
  8              '(((Candle Holders)*7,
  9            ($Candle $Holders)*5,
10            (Candle% Holders%)*3) within PRD_NAME)',
11              1) > 0
12  /
        SC     PRD_ID PRD_NAME                       COMPANY_NA
        28          1 Glass Candle Holder            Comp1
        28          2 Iron Candle Holder             Comp1
        28          3 Metal Candle Holder            Comp2
        28          4 Votive Candle Holder           Comp3
        28          5 Silver Plated Candle Holder    Comp4
        28          6 Gold Plated Candle Holder      Comp4
        28          7 Copper Plated Candle Holder    Comp4
        28          8 Platinum Coated Candle Holder  Comp4
8 rows selected.
SCOTT@10gXE> SELECT *
  2  FROM   (SELECT sc, prd_id, prd_name, company_name,
  3                ROW_NUMBER () OVER
  4                  (PARTITION BY company_name ORDER BY sc DESC) AS rk
  5            FROM   (SELECT SCORE(1) AS SC,
  6                     PRD_ID,
  7                     PRD_NAME,
  8                     COMPANY_NAME
  9                 FROM   PRODUCTS
10                 WHERE  CONTAINS
11                       (DUMMY,
12                        '(((Candle Holders)*7,
13                      ($Candle $Holders)*5,
14                      (Candle% Holders%)*3) within PRD_NAME)',
15                        1) > 0
16                 AND    ROWNUM > 0))
17  WHERE  rk <= 3
18  /
        SC     PRD_ID PRD_NAME                       COMPANY_NA         RK
        28          1 Glass Candle Holder            Comp1               1
        28          2 Iron Candle Holder             Comp1               2
        28          3 Metal Candle Holder            Comp2               1
        28          4 Votive Candle Holder           Comp3               1
        28          5 Silver Plated Candle Holder    Comp4               1
        28          6 Gold Plated Candle Holder      Comp4               2
        28          7 Copper Plated Candle Holder    Comp4               3
7 rows selected.
SCOTT@10gXE>

Similar Messages

  • I am having problem while using ms word with anjal( OS X Lion 10.7.5 (11G63))

    i am having problem while using ms word with anjal  is not working properly but its working in facebook and other areas.i need and  its very important to using tamil fonts for my job.can anyone help me out from this problem.
    thanking you
    by
    moses

    Those who are knowledgable in this area (myself not among them) say that Word's support for Asian languages is faulty. The best word processor for that use is "Mellel."

  • Problems in using Windows Explorer with VPC Virtual PC?

    Has anybody experienced problems in using Windows Explorer with VPC Virtual PC?
    Lacking any "forbidden" or "appropriate usage" guidelines, I regularly use Windows Explorer (Windows 2000) to transfer file from the desktop. I have occasionally sensed that this might be wrong. Today I inadvertently clicked the MAC harddrive instead of the Desktop (within Windows Explorer) and caused all manner of mischief.
    Any other views please?

    Let me correct this:
    I regularly use Windows Explorer (Windows 2000) to transfer files from the "Mac" desktop
    Any ideas please Virtual PC VPC users?

  • AUDIO PROBLEM WHILE USING OR ALONG WITH WEBCAM

    Hi friends,
    SUBJECT : AUDIO PROBLEM WHILE USING OR ALONG WITH WEBCAM
    I'm not getting any sound while using web-cam.
    I tried recording my voice , and played.. i can see my video but audio
    Do we have any settings where i need to cross-check to make sure that everything being turned-on ?
    My laptop details:-
    HP Pavilion dv6 laptop
    Operating system Installed - Windows 7
    Can someone help me with this?
    Thanks
    kiran

    Hi,
    not sure if coincidence or the same question, but the same question got asked internally. The seeded option is required to get the OJSP filter installed. Here's the internal response
    ADF View integration with MDS not configured
    In web.xml, you need to have mds-ojsp intg enabled to load jspx base + customizations from MDS. In your web project in Jdev, go to ADFv project properties and select “Seeded customization” property. It would enable mds-jsp engine configuration in web.xml. If you want to use user personalization feature at runtime, you would need to select “User customization” property as well which would enable ADFv change persistence config in web.xml.
    Warning: Some of the metadata under ... is packaged as part of both WAR and MAR. This metadata cannot be accessed from WAR using MDS.
    For these two packages, you are including the files in both WAR & MAR. This warning conveys that since these base files are being put in MAR, at runtime they would be read from mds repository & not from WAR.
    Frank

  • Problems in using Labview DLL with TestStand!

    Hi,
    I tried to put the VI's to create a TCP/IP Connection, read/write Data to it and close it inside a LabVIEW DLL and use these functions with TestStand.
    The problem is to get access to the ConnectionID generated as TCP Network Refnum in LabVIEW.
    I don't know how to specify the prototype entry for this Refnum in LabVIEW and how to read it with TestStand.
    Another try to pass an ActiveXReference of SequenceContext and use the SetValIDispatch method to set a local variable (Type: ActiveXReference) to the returned ConnectionID of the TCPOpen.VI wasn't successful too.
    It seems to me that the connectionID isn't a normal ActiveXReference.
    Regards,
    Sunny

    Hi Sunny -
    You should treat this parameter as a pointer to an int when calling the DLL from TestStand (or any language like C or C++). Note that you can't do anything with the value outside of LabVIEW since it only has meaning inside of LabVIEW. You can only pass it around for use in other VIs you call from TestStand.
    Hope this helps....
    Kyle G.
    National Instruments
    Kyle Gupton
    LabVIEW R&D
    National Instruments

  • Problem in using socket streams with encryption and decryption

    Hi,
    I am developing a client/server program with encryption and decryption at both end. While sending a message from client it should be encrypted and at the receiving end(server) it should be decrypted and vice versa.
    But while doing so i got a problem if i use both encryption and decryption at both ends. But If i use only encryption at one (only outputstream) and decryption at other end(only inputstream) there is no problem.
    Here is client/server pair of programs in which i am encrypting the outputstream of the socket in client side and decrypting the inputstream of the socket in server side.
    serverSocketDemo.java
    import java.io.*;
    import java.net.*;
    import java.security.*;
    import java.security.spec.*;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    import java.util.*;
    import java.util.zip.*;
    class serverSocketDemo
         public static void main(String args[])
              try
              {                    //server listening on port 2000
                   ServerSocket server=new ServerSocket(2000);
                   while (true)
                        Socket theConnection=server.accept();
                        System.out.println("Connecting from local address : "+theConnection.getLocalAddress());
                        System.out.println("Connection request from : "+theConnection.getInetAddress());
                        //Input starts from here
                        Reader in=new InputStreamReader(getNetInStream(theConnection.getInputStream()),"ASCII");
                        StringBuffer strbuf=new StringBuffer();
                        int c;
                        while (true)
                             c=in.read();
                             if(c=='\n' || c==-1)
                                  break;
                             strbuf.append((char)c);     
                        String str=strbuf.toString();
                        System.out.println("Message from Client : "+str);
                        in.close();               
                        theConnection.close();
              catch(BindException e)
                   System.out.println("The Port is in use or u have no privilage on this port");
              catch(ConnectException e)
                   System.out.println("Connection is refused at remote host because the host is busy or no process is listening on that port");
              catch(IOException e)
                   System.out.println("Connection disconnected");          
              catch(Exception e)
         public static BufferedInputStream getNetInStream(InputStream in) throws Exception
              // register the provider that implements the algorithm
              Provider sunJce = new com.sun.crypto.provider.SunJCE( );
              Security.addProvider(sunJce);
              // create a key
              byte[] desKeyDataDec = "This encryption can not be decrypted".getBytes();
              DESKeySpec desKeySpecDec = new DESKeySpec(desKeyDataDec);
              SecretKeyFactory keyFactoryDec = SecretKeyFactory.getInstance("DES");
              SecretKey desKeyDec = keyFactoryDec.generateSecret(desKeySpecDec);
              // use Data Encryption Standard
              Cipher desDec = Cipher.getInstance("DES");
              desDec.init(Cipher.DECRYPT_MODE, desKeyDec);
              CipherInputStream cin = new CipherInputStream(in, desDec);
              BufferedInputStream bin=new BufferedInputStream(new GZIPInputStream(cin));
              return bin;
    clientSocketDemo.java
    import java.io.*;
    import java.net.*;
    import java.security.*;
    import java.security.spec.*;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    import java.util.*;
    import java.util.zip.*;
    class clientSocketDemo
         public static void main(String args[])
              try
                   Socket theConnection=new Socket("localhost",2000);
                   System.out.println("Connecting from local address : "+theConnection.getLocalAddress());
                   System.out.println("Connecting to : "+theConnection.getInetAddress());
                   //Output starts from here               
                   OutputStream out=getNetOutStream(theConnection.getOutputStream());
                   out.write("Please Welcome me\n".getBytes());
                   out.flush();
                   out.close();
                   theConnection.close();
              catch(BindException e)
                   System.out.println("The Port is in use or u have no privilage on this port");
              catch(ConnectException e)
                   System.out.println("Connection is refused at remote host because the host is busy or no process is listening on that port");
              catch(IOException e)
                   System.out.println("Connection disconnected");          
              catch(Exception e)
         public static OutputStream getNetOutStream(OutputStream out) throws Exception
              // register the provider that implements the algorithm
              Provider sunJce = new com.sun.crypto.provider.SunJCE( );
              Security.addProvider(sunJce);
              // create a key
              byte[] desKeyDataEnc = "This encryption can not be decrypted".getBytes();
              DESKeySpec desKeySpecEnc = new DESKeySpec(desKeyDataEnc);
              SecretKeyFactory keyFactoryEnc = SecretKeyFactory.getInstance("DES");
              SecretKey desKeyEnc = keyFactoryEnc.generateSecret(desKeySpecEnc);
              // use Data Encryption Standard
              Cipher desEnc = Cipher.getInstance("DES");
              desEnc.init(Cipher.ENCRYPT_MODE, desKeyEnc);
              CipherOutputStream cout = new CipherOutputStream(out, desEnc);
              OutputStream outstream=new BufferedOutputStream(new GZIPOutputStream(cout));
              return outstream;
    Here is client/server pair in which i use both encrypting outpustream and decrypting inputstream at both ends.
    serverSocketDemo.java
    import java.io.*;
    import java.net.*;
    import java.security.*;
    import java.security.spec.*;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    import java.util.*;
    import java.util.zip.*;
    class serverSocketDemo
         private Cipher desEnc,desDec;
         serverSocketDemo()
              try
                   // register the provider that implements the algorithm
                   Provider sunJce = new com.sun.crypto.provider.SunJCE( );
                   Security.addProvider(sunJce);
                   // create a key
                   byte[] desKeyData = "This encryption can not be decrypted".getBytes();
                   DESKeySpec desKeySpec = new DESKeySpec(desKeyData);
                   SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
                   SecretKey desKey = keyFactory.generateSecret(desKeySpec);
                   desEnc = Cipher.getInstance("DES");
                   desEnc.init(Cipher.ENCRYPT_MODE, desKey);
                   desDec = Cipher.getInstance("DES");
                   desDec.init(Cipher.DECRYPT_MODE, desKey);               
              catch (javax.crypto.NoSuchPaddingException e)
                   System.out.println(e);          
              catch (java.security.NoSuchAlgorithmException e)
                   System.out.println(e);          
              catch (java.security.InvalidKeyException e)
                   System.out.println(e);          
              catch(Exception e)
                   System.out.println(e);
              startProcess();
         public void startProcess()
              try
                   ServerSocket server=new ServerSocket(2000);
                   while (true)
                        final Socket theConnection=server.accept();
                        System.out.println("Connecting from local address : "+theConnection.getLocalAddress());
                        System.out.println("Connection request from : "+theConnection.getInetAddress());
                        Thread input=new Thread()
                             public void run()
                                  try
                                       //Input starts from here
                                       Reader in=new InputStreamReader(new BufferedInputStream(new CipherInputStream(theConnection.getInputStream(), desDec)),"ASCII");
                                       StringBuffer strbuf=new StringBuffer();
                                       int c;
                                       while (true)
                                            c=in.read();
                                            if(c=='\n'|| c==-1)
                                                 break;
                                            strbuf.append((char)c);     
                                       String str=strbuf.toString();
                                       System.out.println("Message from Client : "+str);
                                  catch(Exception e)
                                       System.out.println("Error caught inside input Thread : "+e);
                        input.start();
                        Thread output=new Thread()
                             public void run()
                                  try
                                       //Output starts from here
                                       OutputStream out=new BufferedOutputStream(new CipherOutputStream(theConnection.getOutputStream(), desEnc));
                                       System.out.println("it will not be printed");
                                       out.write("You are Welcome\n".getBytes());
                                       out.flush();
                                  catch(Exception e)
                                       System.out.println("Error caught inside output Thread : "+e);
                        output.start();
                        try
                             output.join();
                             input.join();
                        catch(Exception e)
                        theConnection.close();
              catch(BindException e)
                   System.out.println("The Port is in use or u have no privilage on this port");
              catch(ConnectException e)
                   System.out.println("Connection is refused at remote host because the host is busy or no process is listening on that port");
              catch(IOException e)
                   System.out.println("Connection disconnected");          
              catch(Exception e)
         public static void main(String args[])
              serverSocketDemo server=new serverSocketDemo();          
    clientSocketDemo.java
    import java.io.*;
    import java.net.*;
    import java.security.*;
    import java.security.spec.*;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    import java.util.*;
    import java.util.zip.*;
    class clientSocketDemo
         private Cipher desEnc,desDec;
         clientSocketDemo()
              try
                   // register the provider that implements the algorithm
                   Provider sunJce = new com.sun.crypto.provider.SunJCE( );
                   Security.addProvider(sunJce);
                   // create a key
                   byte[] desKeyData = "This encryption can not be decrypted".getBytes();
                   DESKeySpec desKeySpec = new DESKeySpec(desKeyData);
                   SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
                   SecretKey desKey = keyFactory.generateSecret(desKeySpec);
                   desEnc = Cipher.getInstance("DES");
                   desDec = Cipher.getInstance("DES");
                   desEnc.init(Cipher.ENCRYPT_MODE, desKey);
                   desDec.init(Cipher.DECRYPT_MODE, desKey);               
              catch (javax.crypto.NoSuchPaddingException e)
                   System.out.println(e);          
              catch (java.security.NoSuchAlgorithmException e)
                   System.out.println(e);          
              catch (java.security.InvalidKeyException e)
                   System.out.println(e);          
              catch(Exception e)
                   System.out.println(e);
              startProcess();
         public void startProcess()
              try
                   final Socket theConnection=new Socket("localhost",2000);
                   System.out.println("Connecting from local address : "+theConnection.getLocalAddress());
                   System.out.println("Connecting to : "+theConnection.getInetAddress());
                   Thread output=new Thread()
                        public void run()
                             try
                                  //Output starts from here               
                                  OutputStream out=new BufferedOutputStream(new CipherOutputStream(theConnection.getOutputStream(), desEnc));
                                  out.write("Please Welcome me\n".getBytes());
                                  out.flush();
                             catch(Exception e)
                                  System.out.println("Error caught inside output thread : "+e);
                   output.start();     
                   Thread input=new Thread()
                        public void run()
                             try
                                  //Input starts from here
                                  Reader in=new InputStreamReader(new BufferedInputStream(new CipherInputStream(theConnection.getInputStream(), desDec)),"ASCII");          
                                  System.out.println("it will not be printed");
                                  StringBuffer strbuf=new StringBuffer();
                                  int c;
                                  while (true)
                                       c=in.read();
                                       if(c=='\n' || c==-1)
                                            break;
                                       strbuf.append((char)c);     
                                  String str=strbuf.toString();
                                  System.out.println("Message from Server : "+str);
                             catch(Exception e)
                                  System.out.println("Error caught inside input Thread : "+e);
                   input.start();
                   try
                        output.join();
                        input.join();
                   catch(Exception e)
                   theConnection.close();
              catch(BindException e)
                   System.out.println("The Port is in use or u have no privilage on this port");
              catch(ConnectException e)
                   System.out.println("Connection is refused at remote host because the host is busy or no process is listening on that port");
              catch(IOException e)
                   System.out.println("Connection disconnected");          
              catch(Exception e)
         public static void main(String args[])
              clientSocketDemo client=new clientSocketDemo();     
    **** I know that the CInput tries to read some header stuff thats why i used two threads for input and output.
    Waiting for the reply.
    Thank you.

    Do not ever post your code unless requested to. It is very annoying.
    Try testing what key is being used. Just to test this out, build a copy of your program and loop the input and outputs together. Have them print the data stream onto the screen or a text file. Compare the 1st Output and the 2nd Output and the 1st Input with the 2nd Input and then do a static test of the chipher with sample data (same data which was outputted), then do another cipher test with the ciphertext created by the first test.
    Everything should match - if it does not then follow the steps below.
    Case 1: IO Loops do not match
    Case 2: IO Loops match, but ciphertext 1st run does not match loop
    Case 3: IO Loops match, 1st ciphertext 1st run matches, but 2nd run does not
    Case 4: IO Loops match, both chiphertext runs do not match anything
    Case 5: Ciphertext runs do not match eachother when decrypted correctly (outside of the test program)
    Problems associated with the cases above:
    Case 1: Private Key is changing on either side (likely the sender - output channel)
    Case 2: Public Key is changing on either side (likely the sender - output channel)
    Case 3: Private Key changed on receiver - input channel
    Case 4: PKI failure, causing private key and public key mismatch only after a good combination was used
    Case 5: Same as Case 4

  • Problems in using a certificate with  different versions of JVM

    Hi friends,
    I am facing a typical problem:
    I have to use a certificate which uses the sha1DSA signing algorithm to contact a web service(I am coding a client). I was using J2SDK_1.4.1_02 before. I added the certificate to keystore and it was working fine. But if I upgraded my JRE to 1.4.2_13 the same code doesn't work,. I got the following exception:
    javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
         at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA12275)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
         at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA12275)
         at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA12275)
         at com.sun.net.ssl.internal.ssl.SunJSSE_ax.a(DashoA12275)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA12275)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.b(DashoA12275)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(DashoA12275)
         at sun.net.www.protocol.https.HttpsClient.afterConnect(DashoA12275)
         at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(DashoA12275)
         at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:570)
         at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(DashoA12275)
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:263)
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection$PriviledgedPost.run(HttpSOAPConnection.java:151)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:121)
         at TestRequest.getCustomerInfo(TestRequest.java:60)
         at TestRequest.main(TestRequest.java:122)After some investigation I found that this JRE is accepting only certificate with sha1RSA signature algorithm. Please help me if anybody knows why this occurs or is this an issue which is to be addressed in server side.

    Hi Michal,
    Keeping in mind the recommendations of the Production Checklist...
    All other things being equal, homogenous deployments are usually less prone to surprises.
    But JDK 1.6 is noticeably faster than JDK 1.4, and features much better JMX support as well, so it's a probably the better option.
    Jon Purdy
    Oracle

  • Problem in using sybase drivers with JDK 1.5

    hi all,
    i have an app that is connecting to a sybase database.
    so far i have run it using jdk 1.4 using sybase jconn2.jar , it has workedf ine.
    Now, i haven't changed the code, i just recompiled it and re-run it using jdk 1.5 , and suddenly i am getting a classNotFoundException
    java.lang.ClassNotFoundException: com.sybase.jdbc2.jdbc.SybDriver
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at BNPParibas.Collateral.SQL.SQLConnectionFactory.DoConnection(SQLConnec
    tionFactory.java:65)
    at BNPParibas.Collateral.SQL.SQLConnectionFactory.Connect(SQLConnectionF
    actory.java:29)
    at BNPParibas.Collateral.SQL.ResultSetFactory.<init>(ResultSetFactory.ja
    va:27)
    at BNPParibas.Collateral.Batch.Flow.FlowControl.load(FlowControl.java:81
    at BNPParibas.Collateral.Batch.Flow.FlowControl.<init>(FlowControl.java:
    62)
    at BNPParibas.Collateral.Batch.Flow.FlowControl.main(FlowControl.java:37
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Appe
    nder
    at BNPParibas.Collateral.Batch.Flow.FlowControl.load(FlowControl.java:16
    8)
    at BNPParibas.Collateral.Batch.Flow.FlowControl.<init>(FlowControl.java:
    62)
    at BNPParibas.Collateral.Batch.Flow.FlowControl.main(FlowControl.java:37
    and NOTHING has changed except that now i am runnign java 1.5 instead of 1.4
    has anyone ever experienced a similar problem?
    regards
    marco

    Hello,
    well, yes it is.
    Running the code with jdk 1.4 is absolutely fine.
    if i run it like this
    <myjdk14install>\bin\java -jar xxx.jar works fine
    if i run it l ike this (which will use 1.5 by default)
    java -jar xxx.jar it gives me that exception...
    have the classloading mechanism changed between jdk 1.4 and jdk 1.5?
    regards
    marco

  • Problem in using Infoswing GridControl with jre 1.3

    Hi,
    I'm using the InfoSwing GridControl which is bound to a table ....the problem is that when I deploy it and run the applet in the browser then it shows a blank row when I scroll down towards the end of the rows.
    I'm using the java Plug-in and jre 1.3. IF I OPEN THE SAME APPLET IN BROWSER AND RUN IT JRE 1.2 THEN IT WORKS FINE. ?? Why So ??
    Thanx in Advance,
    Jigar.

    Hello,
    well, yes it is.
    Running the code with jdk 1.4 is absolutely fine.
    if i run it like this
    <myjdk14install>\bin\java -jar xxx.jar works fine
    if i run it l ike this (which will use 1.5 by default)
    java -jar xxx.jar it gives me that exception...
    have the classloading mechanism changed between jdk 1.4 and jdk 1.5?
    regards
    marco

  • Problem in using JDeveloper 10g with JHeadstart

    I am using JDeveloper 9.0.3 and jheadstart 9.0.4.5 and I would like to test jdeveloper 10g preview with JHeadstart.
    So, I have downloaded the JDeveloper 10g to test it with my old application.
    Having run the Jdeveloper for the first time, I realized that Jdeveloper
    installed the jheadstart automatically and following message was shown in the message window :
    E:\Software\10g\JDev10g\jdev\lib\ext\jheadstart\PrjWizard.jar!\META-INF\jdev-ext.xml
    Error: <Line 12, Column 24>: XSD-2034: (Error) Element 'description' not expected.
    Error: <Line 13, Column 17>: XSD-2034: (Error) Element 'help' not expected.
    Error: <Line 17, Column 27>: XSD-2034: (Error) Element 'dependency_addin' not expected.
    Converting JDeveloper 9.0.3 extension manifest to 9.0.5
    E:\Software\10g\JDev10g\jdev\lib\ext\jheadstart\JhsShare.jar!\META-INF\jdev-ext.xml
    Converting JDeveloper 9.0.3 extension manifest to 9.0.5
    E:\Software\10g\JDev10g\jdev\lib\ext\jheadstart\MvcFrameworkServiceFileViewer.jar!\META-INF\jdev-ext.xml
    Converting JDeveloper 9.0.3 extension manifest to 9.0.5
    E:\Software\10g\JDev10g\jdev\lib\ext\jheadstart\JHeadstartDesignerGenerator.jar!\META-INF\jdev-ext.xml
    Converting JDeveloper 9.0.3 extension manifest to 9.0.5
    E:\Software\10g\JDev10g\jdev\lib\ext\jheadstart\JAGLauncher.jar!\META-INF\jdev-ext.xml
    Converting JDeveloper 9.0.3 extension manifest to 9.0.5
    E:\Software\10g\JDev10g\jdev\lib\ext\jheadstart\Bc4jPropertyEditor.jar!\META-INF\jdev-ext.xml
    Converting JDeveloper 9.0.3 extension manifest to 9.0.5
    E:\Software\10g\JDev10g\jdev\lib\ext\jheadstart\JASEditor.jar!\META-INF\jdev-ext.xml
    Converting JDeveloper 9.0.3 extension manifest to 9.0.5
    So I try to test one of my old application with this configuration. After Jdeveloper migrated my workspace and projects and business componenet
    to the newer version, I run the application generator. It worked fine without any problem but after running the application, I got an error page showing
    that my bc4j.xcfg is not in the path.
    On the other hand, I found out that when I wanted to view my UIX pages, 2 dialog boxes appeared. The first one asked to upgrade
    to UIX 2.2's new expression language syntax and the other which is on the top of the first one, showing that UIX runtime failed to render the page
    with following detail :
    javax.servlet.ServletException: No page broker found!
         at oracle.cabo.servlet.PageBrokerHandler.handleRequest(Unknown Source)
         at oracle.cabo.servlet.UIXServlet.doGet(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at oracle.cuervo.share.servlet.PreviewServletContainer.handleRequest(PreviewServletContainer.java:305)
         at oracle.cuervo.share.servlet.PreviewServletContainer.handleRequest(PreviewServletContainer.java:229)
         at oracle.cabo.ide.addin.preview.UIXRenderThread._reallyLoad(UIXRenderThread.java:263)
         at oracle.cabo.ide.addin.preview.UIXRenderThread.runImpl(UIXRenderThread.java:203)
         at oracle.cabo.ide.addin.preview.BasePreviewThread.run(BasePreviewThread.java:79)
    I think that I should have set some setting before use JHeadstart with JDeveloper.
    Could anybody help me ?

    Alex,
    The document Sandra referred to applies to JDeveloper 10g preview (9.0.5.0). JHeadstart 9.0.4.5 will NOT work with JDeveloper 109 production (9.0.5.1).
    We plan to release a new version end of april that is compatible with 9.0.5.1. See this thread for more info: JDeveloper 10g production, status JHeadstart?
    Steven Davelaar,
    JHeadstart Team.

  • Problem in using Jasper Reports with JFrames

    Hi,
    I am using Jasper Reports in Swings.
    I could Generate Jasper Reports from JFrames with out any problem,
    but while closing the Report, the JFrame is also getting closed automatically.
    this should not happen for my application.
    So, how could i restrict the JFrame from exiting when Jasper Reports are closed.
    Thanx in advance.
    Reddy

    Create jasperviewer object as JasperViewer jasperViewer = new JasperViewer(jasperPrint, false);

  • Problem removing a partition created with OSX Lion

    Hello,
    I have two partitions on my MacbookPro. The first contains Lion the second SL. I am removing Lion (battery life is halfed as the OS is much more processor intensive). The SL partition boots and works fine and has the latest version of all OS files.
    My goal is to remove the Lion partition (and the rescue partiton).
    I have tried:
    1. From the disk utility in the SL partition: Unmounting partition 1. and deleting it. It tells me that it is an error and it is unable to delete this partition.
    2. From the disk utility in the SL partition: Erasing all data on the partition and formatting with the journaling option. Same error as 1.
    3. Booting into the Lion rescue partition and running Disk utility from there (version 12.0). Same error as 1.
    Does anyone know how I can delete this partition, delete the rescue disk partition and merge the two?
    Many thanks for any and all help!
    James

    Yep, just install iDVD (plus sounds and jingles) and iWeb if you want it (but note that iWeb apparently won't work if you upgrade to Mountain Lion).
    Then use Software Update to get any late iDVD updates.

  • Problems connectig using WPA Enterprise with Leopard

    I updated my software yesterday, but today i could not log on to the network at my university. There were no problems with the Windows XP pcs I tested. It wonder if it might have something to do with the password reseting itself - when I enter the network preferences screen the password section is blank even if I ask Leopard to remember it.
    It seems to accept my password and shows signal strength varying from between two points and full strength, but is listed as disconnected by network diagnostics.
    If any of you have experienced similar problems any help would be appreciated.
    -jonsef-

    Welcome to Apple Discussions.
    If you are using WPA Enterprise to connect, it's likely that you did so using 802.1X under Mac OS X 10.4 before installing Leopard. This mechanism has changed in Mac OS X 10.5 and it is clearly not performing as expected, and causing serious problems for enterprise and higher education users.
    Insert the string <802.1X> in the Search Box in the upper right corner, and you'll see a number of posts about this issue by academic computing staff personnel, who are working cooperatively to identify the issues involved, and find workarounds until the matter can be addressed by Apple.
    I suggest also that you contact an AppleCare representative at (800) APL CARE and initiate a case. Be prepared for very long wait on hold times, possibly 45 minutes or more. They are flooded with requests, but it's important that additional pressure be placed on them to escalate these reported cases for resolution.

  • Problem while using PrepStmt.executeBach with Weblogic 6.0sp1 and

     

    - I'm getting the same error when I use WLS 6.0 SP1 & thin driver. I'm not
    getting this error when I use thin driver without WLS.
    - This is definitely a bug in WLS. As a workaround put classes.zip {that
    comes with oracle installation} before weblogic.jar in your classpath. This
    way, classloader will load the oracle supplied classes & everything will
    work smoothly
    Manav
    "Joseph Weinstein" <[email protected]> wrote in message
    news:[email protected]...
    >
    >
    Ruta wrote:
    Hi Joe
    I tried using a java standlaone program using prep stmts and oracle thin
    driver
    and it works just fine.
    So is this a bug with Weblogic? Finally connection pooling isapplication server's
    responsibility, isnt it..
    I am inlcined to conclude this coz connection pooling works fine withStatement.executeBatch()
    but not with prepStatement.executeBatch()
    How do I resolve this now.
    Thanks
    Ruta
    ...Does it not release the connectionOk. Now let me see the JDBC code example. I'll see what's up.
    Joe
    Joseph Weinstein <[email protected]> wrote:
    The first thing you should do is to reduce the problem to the simplest
    form.
    Write a tiny standalone program that just uses the thin driver
    directly,
    and repeats the code you are trying to run. This will eliminateWebLogic
    from the equation and see if it's an Oracle-only bug.
    Joe
    Ruta wrote:
    Hi,
    I am trying to do multiple inserts in a table using the
    PreparedStatement
    of JDBC2.0.
    I am using a TxDataSource of Weblogic server with a thin driver
    oracle
    pool. I
    am using the driver classes that come with the weblogic.jar.
    The problem is as follows:
    I can manage to succesfully do the executeBatch a few
    times..Interestingly
    it
    executes as many no. of times as the Initial capacity(not even maxcapacity) of
    my connection pool.
    Then it gives me the following error:
    java.sql.SQLException: java.sql.SQLException: Missing IN or OUT
    parameter
    at index::
    1
    at
    weblogic.jdbc.rmi.SerialStatement.executeBatch(SerialStatement.java:394)
    atcom.equitable.acs.common.ACSCtrlBean.saveSDECData(ACSCtrlBean.java:147)
    atcom.equitable.acs.common.ACSCtrlBeanImpl.saveSDECData(ACSCtrlBeanImpl.java:1
    10)
    atcom.equitable.acs.common.ACSCtrlBeanEOImpl.saveSDECData(ACSCtrlBeanEOImpl.ja
    va:30)
    atcom.equitable.acs.common.ACSCtrlBeanEOImpl_WLSkel.invoke(ACSCtrlBeanEOImpl_W
    LSkel.java:133)
    atweblogic.rmi.internal.BasicServerAdapter.invoke(BasicServerAdapter.java:373)
    atweblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java
    :128)
    atweblogic.rmi.internal.BasicServerAdapter.invoke(BasicServerAdapter.java:237)
    atweblogic.rmi.internal.BasicRequestHandler.handleRequest(BasicRequestHandler.
    java:118)
    atweblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:1
    7)
    atweblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    This Oracle error has error code 17041.. I could not find more infoon it, even
    from the Oracle site.
    I conclude that the connections are not getting relesed.
    But i ahve written
    con.close(); even
    con=null; (out of desparation :) )
    but still the connection is not released.
    I am getting the connection in the saveSDECData method
    I need to fix thsi problem ASAP..Any Help/Comments will be
    appreciated..
    Finally the most interesting part is :
    executeBatch works perfectly fine with the Statement object..
    so probably the culprit is the PreparedStatement implementation ofOracle..Can
    anybody validate this pls
    Regards
    Ruta--
    PS: Folks: BEA WebLogic is expanding rapidly, with both entry andadvanced
    positions
    for people who want to work with Java, XML, SOAP and E-Commerceinfrastructure
    products.
    We have jobs at Nashua NH, Liberty Corner NJ, San Francisco and SanJose
    CA.
    Send resumes to [email protected]
    PS: Folks: BEA WebLogic is expanding rapidly, with both entry and advancedpositions
    for people who want to work with Java, XML, SOAP and E-Commerceinfrastructure products.
    We have jobs at Nashua NH, Liberty Corner NJ, San Francisco and San JoseCA.
    Send resumes to [email protected]

  • Performance Problems by using a subreport with a SAP BW Query

    Hello Experts,
    we have the following scenario:
    - Crystal Reports Report (CRR) on top of a SAP BW Query
    - SAP BW Query contains a member structure with Month, Year, Prior Year and total
    If I now put some details of a dataset in the main report (e.g. key is project number) and the structure and the characteristic structure in a subreport (linked e.g. by the key project number), the CRR takes like 7,5 hours to display completely. If I don´t use a subreport it takes less then 10 minutes to display (in the preview section of Crystal Reports).
    Is such a significant difference in run time normal ? I have to mention that the used query is quite complex (but this is unavoidable). And it seems also unavoidable to use the subreport to get the desired result in terms of formatting:
    - if I don´t use the subreport and more than one characteristic for the details, the structure which is supposed to display the values for each projects like this
    Month
    Year
    Prior Year
    Total
    gets 'dissolved' - first, Month is listed for each project, than Year is listed for each project, etc. This is only avoidable if use only one characteristic and its attributes, but no other characteristics (that are no attribute to the first one). But of course this is not what the customer wants...
    - so my only solution up to now is to list the desired details in the main report and then next to them the structure and the key figure data in the subreport, so that the structure is listed as in the query - but then as mentioned the performance is awful !
    Many thanks in advance for your help !
    Frank

    Hi Frank
    Have you tried using a join in the main report rather than using the subreport linked on the Project Key Code.
    Try joining the query in the main report with the query in the subreport as a single query in the main report.
    Let me know your observations.
    Regards
    Nikhil

Maybe you are looking for

  • Why won't my iPod touch (4th gen) no longer connect to wifi?

    Yesterday I noticed that my iPod Touch (4th generation) was no longer connected to my home wifi. It can see the network, but it won't connect. There is no error message of any kind, but the spinning wheel thing comes up to the left of the network nam

  • ValueChangeListener in a Region

    Hi, I have added a valuechangelistener to a SelectOneChoice componenet in a region. At runtime, when i change the value in the lov, it doesnot call the method of valuechangelistener, where as if the add the same component with same valuechangelistner

  • Bubble chart settings

    Hi , I am trying to build the bubble chart as silimar  in the  below link http://it.usaspending.gov/?q=content/analysis when I click on any of the bubble I can see the round circle  & a textt around the bubble how can this be done.Please let me known

  • MTU Settings - Xbox Live

    Hello, so i just recently installed internet, i'm using telus and my modem is a thomson speed touch. Xbox live will not work because the mtu setting is too low. How do i change the setting so the xbox will work? Please and thank you!

  • Do not want slim keyboard

    I bought a new 20" iMac from a store in Medford Oregon while on my honeymoon (just got married). The only Mac stores I know of in Oregon are in Portland, which was a bit too far north for us to travel (we live in California), so we got it from a loca