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

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

  • 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

  • Account Password Changed When Using OCI Drivers With WebLogic 6.0

    Hello all,
    Could be I am losing my mind but I saw some strange bahavior and I was wondering if anyone could offer an explination. We're running BEA WL6.0sp2 on an HPUX box with both an 8.1.7 client and server installation for development. We noticed that when we try to use the OCI driver to connect to our database, the password for our account is being changed on connection. This is definitely repeatable as we demonstrated it for the DBAs while they yelled at us. I highly doubt there is anything in WL that would cause the problem and everything works fine with the Thin drivers, with the JDrivers provided by BEA and with the credentials from SQL+.
    Our problem is we need the Layer 2 OCI support. Is there something in the OCI client installation that would cause this behavior?

    Hello all,
    Could be I am losing my mind but I saw some strange bahavior and I was wondering if anyone could offer an explination. We're running BEA WL6.0sp2 on an HPUX box with both an 8.1.7 client and server installation for development. We noticed that when we try to use the OCI driver to connect to our database, the password for our account is being changed on connection. This is definitely repeatable as we demonstrated it for the DBAs while they yelled at us. I highly doubt there is anything in WL that would cause the problem and everything works fine with the Thin drivers, with the JDrivers provided by BEA and with the credentials from SQL+.
    Our problem is we need the Layer 2 OCI support. Is there something in the OCI client installation that would cause this behavior?

  • 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

  • Error while using sybase trigger with the CMP entity bean,ejb version 2.1

    Hi All,
    I am using ejb version 2.1 and using entity bean (Transaction required) ,i am trying to update data in sybase(ver 12.3) database table
    I am using session bean(Transaction required) to update the multiple entity beans in a while loop.It is working fine .But when i am trying to run it with the trigger which updates multiple tables in different sybase databases on update of each entity.Then it throws NoSuchEntityException and it rollback the whole transaction.
    My trigger has only few simple update statements and the trigger runs fine without my CMP entity bean.is the CMP does not support the update triggers in sybase or is it the problem with the transaction.
    Please help
    Thanks
    Anshu

    If you can have a look at a cmp example in the samples that ship with the server. My guess is that the weblogic-ejb-jar.xml file is missing the <persistence-use> element which for 810 would look like:
    <persistence>
    <persistence-use>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>7.0</type-version>
    <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
    </persistence-use>
    </persistence>
    I seem to recall that the elements might be slightly different in structure for the wls700 version of the DTD, so please check that (I cannot, I'm at home and don't have everything here).
    Give that a try and see if it doesn't solve your compilation failure.
    Also, the compilation should not be throwing a null pointer exception in a case like that, I consider that to be a bug.
    -thorick

  • 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 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

  • 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>

  • 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);

  • 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.

  • Using LabView drivers with LabWindows

    Hi.
    I'm planning on using LabWindows to operate a progRes camera, which states they have labview drivers. I'm assuming that labview drivers will work with LabWindows, but just thought I'd ask if that's a valid assumption. (I've never used either program before)

    Typically, when a piece of harwdware says it had LabVIEW drivers, this means that it has utlity or accessibility functions for LabVIEW. As LabVIEW is its own language, and LabWindows is a C editor/compiler, LabVIEW functions or .vi's will not inherently work in LabWindows/CVI.
    While it is definitely possible to call LabVIEW code from LabWindows/CVI, you will most likely want to see if there is a C interface for the hardware from LabWindows/CVI.
    Hope this helps.
    Peter Flores
    Applications Engineer

Maybe you are looking for