Oracle Method 4 - How to do in Java?

Hi,
I need to implement a Java application that performs some (quite big) select statements, but the select parameter list can be created only during runtime.
Same goes for the WHERE clause.
I stumbled across the Oracle Mehtod 4 in the book Pro*C/C++ Programmer's Guide.
This seems to be exactly what I need, but not in C/C++!
Are there any recommendations/alternatives for doing things like with the Oracle Method 4 in Java?
Thank you very much.

For those people who have not read / do not have a copy of "Pro*C/C++ Programmer's Guide" (probably the majority of us!)On the contrary, we all have it!
[Method 4|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14407/pc_13dyn.htm#sthref1797]
Regards
Peter

Similar Messages

  • Call Oracle procedure with custom data type within Java and Hibernate

    I have a custom date TYPE in Oracle
    like
    CREATE TYPE DATEARRAY AS TABLE OF DATE;
    and I have a Oracle function also
    like
    CREATE OR REPLACE FUNCTION doesContain (list DATEARRAY, val VARCHAR2) RETURN NUMBER
    IS
    END doesContain;
    In my Java class,
    I have a collection which contain a list of java.util.Date objects
    When I call Oracle function "doesContain", how to pass my java collection to this Oracle function ...
    anyone can provide solutions?
    Please !!!
    Thanks,
    Pulikkottil

    Vu,
    First of all you need to define your types as database types, for example:
    create or replace type T_ID as table of number(5)Then you need to use the "oracle.sql.ARRAY" class. You can search this forum's archives for the term "ARRAY" in order to find more details and you can also find some samples via the JDBC Web page at the OTN Web site.
    Good Luck,
    Avi.

  • Is there a tutorial on - how to call static java methods

    I have defined external JAVA resource using a .jar file and have successfully catalogged the same. Now I need to pass variables to a static method in a class and also get the return variable mapped into a BPM variable.
    Can someone share sample Java Invokation code, how to call methods in a class, how to instantiate a singleton or reference an existing instance of singleton class.
    Any sample code or sample projects will be useful.
    Also can I se ethe java system.out.println output in BPM Logviewer
    Arvind

    Hi Arvind,
    Sure you've done this, but the first step is to catalog the Jar file. Before an Oracle BPM project can use the Java component, the appropriate Java JAR files must be added to the project.
    Add the Jar File(s) to the External Resources:
    1. Right-click the External Resources item in the Project Navigator tab
    2. From the pop-up menu, select New External Resource.
    3. Name this new Java resource "MyNewJavaComponents" and ensure its type is Java Class Library.
    4. Add the Java jar file(s)
    Catalog and Expose the Java Components:
    5. Add a new module in the Catalog called "IntegrationComponents".
    6. Generate a Java integration component by right-clicking the IntegrationComponents module and select "Catalogue Component" -> "Java".
    7. Using the Java configuration you just created called MyNewJavaComponents, click the Next button to automatically introspect the Java libraries.
    8. Select the class where your method(s) are located and click the Next -> Finish buttons to have Oracle BPM generate the integration component for you.
    9. If you expand the newly exposed Java component, you can see a method has been created for each public method (attributes would also be automatically created if this class had any public attributes). If you've included the appropriate BeanInfo class in the JAR, you'll note that the method parameters are appropriately named.
    How to Invoke Public Java methods Exposed in the Catalog:
    10. Open the method editor for an automatic activity in the process (or any BPM Object method with its "Server Side" property set to "Yes").
    11. Drag one of the Java methods you just exposed inside your IntegrationComponents module into the automatic activity's method. Once you drag it in, here's what you might see if you're using the Java syntax in Oracle BPM's method editor:
    (PdfGenerator).generate(outputFilename : "", contents : {  }, logoImageURL : null, signatureImageURL : null);
    Assuming you have "outputFilename", "sampleContent", "logoURL" and "signatureURL" variables already created in your process, change the method you just dragged in to:
    IntegrationComponents.Pdfservice.PdfGenerator.generate(outputFilename : outputFilename, contents : sampleContent,
    logoImageURL : logoURL, signatureImageURL : signatureURL);
    Hope this helps,
    Dan

  • How to import custom java jar/class into oracle to be used in java proc ?

    Hi
    I would like to know how to import custom java jar/class files into oracle to be used in java stored procedure.
    I am developing a oracle pl/sql procedure to call java program. The java program will be created as procedure and will be published.
    But, my question is that I do have a other external jar/class file that need to be imported into this java program.
    example
    raise_sal.java
    import java.util.*;
    import oracle.sql.*;
    <<reference other java programs >>
    import cmpmsgsvc.xxxx.* ;
    import cmpmsgsvc.yyyy.* ;
    import cmpmsgsvc.zzzz.* ;
    how do I import the cmpmsgsvc jar/class file into oracle so that I don't have any
    compilation errros on raise_sal.java program ??
    what are the steps to import/compile and validate to do this?
    thanks for your help in advance.
    Thanks
    rrb.

    Kuassi
    Problem is that, I have 6 jar files that are needed to be included in the main java program. And, there are more than 50+ classes, propertiers in those 6 jar files.
    It might be not good idea to have all those 50+ classes in the production database.
    Is there anyway that I keep all those 6 jar files in unix box (our's is oracle erp installation with oracle being installed on unix box) and just refer them in the main java program. I mean database will be loaded with main java program and it should able to refer other 6 jar files from unix.
    if we create a directory and keep all jar files in there and include that directory in classpath variable, does this works? or what is other method?
    Please let me know.
    Thanks

  • How to copy the java concurren program in oracle application

    Hi All
    I am working in oracle Apps R12.
    In AP (Account Analysis Report) is registered as java concurrent Program.
    Now i need to customize this concurrent program and add two new column and two parameter in that.
    Could any one pls provide me the steps that how to copy the Java concurrent,and make a new customized program.
    Whether copying a java concurrent program is same as cp registered as oracle report.
    Thanks & Regards
    Srikkanth

    Hi Sir,
    Thanks for your reply.
    I have find the xml file form data definition and in that they have written Sql query and they have called a Package.
    And the i have also taken the class file from the path as mentioned.
    Now i need to customize this report by adding two parameter and i need to add two new column to display in the rtf.
    Can you pls tell me the steps to copy or how to customize this report.
    Regards
    Srikkanth

  • How can we call java control source methods within jsp

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

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

  • How do I install JAVA JVM, JServer and XDK in Oracle Express Ed database

    IF I query with SELECT COUNT(*) FROM all_objects WHERE object_type LIKE 'JAVA%'; I get a count of 0.
    I see no DBMS_JAVA package.
    How can I install JAVA JVM, JServer and XDK in the Oracle Express Edition database?
    I see no initjvm.sql, initxml.sql and xmlja.sql scripts. There are catjava.sql and catexf.sql scripts in the rdbms/admin folder.

    cssifah,
    Looks like you want this Web page:
    http://www.oracle.com/technology/products/database/xe/forum.html
    Good Luck,
    Avi.

  • How to invoke a Java Program from Oracle 10g?(uRGENT)

    Hello.
    I've a query, that i have a program, that basically retreives the records from the
    oracle table and then parser this information and then insert the values in corresponding database base tables. I want that, whenever the new program is inserted, a Trigger should fire and pass the most recently entered record to the Parser Program, means
    1) Firing a Trigge
    2)Storing the most latest data and pass it to the Parser PROGRAM
    Can someone tell me how to do this? How to invoke a Java Program from within the database? Please if anyone has examples provide me. Its very urgent and tell me what is the basic mechanism.
    Thankyou.
    Ben

    With Java Stored Procedures Java may be caleed from a database.
    http://www.oracle.com/technology/tech/java/jsp/index.html

  • How to upload a java application into the oracle DB

    Hello,
    I am in search of an issue that is worrying me now for weeks. I have a java application which is independent. Now I want to upload this application to the oracle DB.The idea is for the application to sit on the DB and do it work from there, which is to transfer data to another 3rd party independent system. What is the best way of doing this? Is there any utility which can help me to upload a java application to the DB?
    Also after uploading the application in the DB, how can it be called? Is there any tutorial to guide me please?
    Thank you all for brain storming

    Check the docs for "Java Stored Procedure":
    http://www.oracle.com/pls/db92/print_hit_summary?search_string=java+stored+procedure

  • How to connect from java without using oracle client installation

    hi ,
    Please tell me how to connect from java without using oracle client
    Thanks & Regars

    http://www.orafaq.com/wiki/JDBC#Thin_driver

  • How to load a java script in oracle database

    Is it possible to load d java script in Oracle database. while the object type is
    java resource ..

    RENUJP wrote:
    I meant to load a javascript to oracle database not to oracle appliocation.
    like loadjava....
    I can load a javascript to oracle database.. but i can't call it...Please re-read the comments above, especially the part about this not being a javascript nor oracle forum. Exactly what part about this information don't you understand?

  • How to call a java method in a Stored procedure

    Hi.,
    I was trying to call a method in a stored procedure
    This was my procedure
    CREATE OR REPLACE PROCEDURE proc_copy_file(sr_file VARCHAR2,dt_file VARCHAR2)
    AS LANGUAGE JAVA
    NAME 'FileCopy.copyfile(String,String)'; // calling a java method
    /   this was my java method
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "FileCopy" as
    import java.io.File;
      import java.io.IOException;
      import java.io.FileReader;
      import java.io.FileWriter;
      import javax.imageio.stream.FileImageInputStream;
      import javax.imageio.stream.FileImageOutputStream;
      import java.security.AccessControlException;
      public class FileCopy {
          // Define variable(s).
              private static int c;
              private static File file1,file2;
              private static FileReader inTextFile;
              private static FileWriter outTextFile;
              private static FileImageInputStream inImageFile;
              private static FileImageOutputStream outImageFile;
              // Define copyText() method.
              public static void copyfile(String fromFile,String toFile) throws AccessControlException
                // Create files from canonical file names.
                file1 = new File(fromFile);
                file2 = new File(toFile);
                // Copy file(s).
                try
                  // Define and initialize FileReader(s).
                  inTextFile  = new FileReader(file1);
                  outTextFile = new FileWriter(file2);
                  // Read character-by-character.
                  while ((c = inTextFile.read()) != -1) {
                    outTextFile.write(c); }
                  // Close Stream(s).
                  inTextFile.close();
                  outTextFile.close(); }
                catch (IOException e) {
                  System.out.println ("-------"); }
             // return 1;
          public static void main(String[] args){
                          switch(args.length){
                                  case 0: System.out.println("File has not mentioned.");
                                                  System.exit(0);
                                  case 1: System.out.println("Destination file has not mentioned.");
                                                  System.exit(0);
                                  case 2: copyfile(args[0],args[1]);
                                                  System.exit(0);
                                  default : System.out.println("Multiple files are not allow.");
                                                    System.exit(0);
    };while i am executing this method i m getting error as
    ORA-29531: NO METHOD COPYFILE IN CLASS FILECOPY
    ORA-06512: AT "RMVER721.PROC_COPY_FILE", LINE 1could anyone help me

    Looks like it is a matter of not quite the same namespace for String object.
    I can get it to work by the java source containing:
              public static void copyfile(java.lang.String fromFile,java.lang.String toFile) throws AccessControlExceptionAnd the PL/SQL source:
    NAME 'FileCopy.copyfile(java.lang.String,java.lang.String)'; // calling a java methodSeems like when you just use "String", then the namespace resolving in the java source is not the same as the namespace resolving in the PL/SQL?
    Addendum:
    You do not need to put java.lang.String in the java source, String will do (java.lang is by default "imported"?)
    But in the PL/SQL source java.lang namespace prefix is needed - java.lang is not "imported" here.
    Edited by: Kim Berg Hansen on Nov 23, 2011 1:07 PM

  • How to resolve oracle.jbo.Key cannot be cast to java.util.List?

    Hi experts,
    I am getting this error (oracle.jbo.Key cannot be cast to java.util.List) PPR# . . . . . while filtering in grid..
    give some idea to solve this please...
    Note: (This error is occurs only in JDev ver 11.1.1.3.0 and its working fine in 11.1.1.2.0)
    Regards,
    Gops

    I guess information is too less, could you provide some more info ?
    Amit

  • How to invoke a Java class constructor in Forms

    I want to Run this ( http://persiancalendar.sourceforge.net/) Persian calendar in forms. I am using Forms 10g Rel 2 (Forms [32 Bit] Version 10.1.2.0.2 (Production))
    I did this:
    (1.) Downloaded the 2 Jar files persiancalendar.jar and icu4j_3_2_calendar.jar
    (2.) Deployed jar files in forms\java
    (3.) Added entries in FORMS_BUILDER_CLASSPATH and formsweb.cfg
    (4.) The 2 jar files get loaded to the JAR cache when form runs.
    Now, in order to invoke the Persian calendar according the documentation you have to invoke the constructor in class PersianCalendar.
    PersianCalendar() Constructs a Persian calendar with the default time zone and locale.
    In Forms the FBean package can invoke only methods. I tried combinations of inputs but without any success.
    According to the documentation this is the only class to create a calendar. All other classes are either utilities or get/set methods.
    How can I do this?

    PersianCalendar() is the constructor of the class; it will be invoked when you instantiate the class. This happens when you register your bean at runtime (assuming you are talking about the FBean Package):
    http://www.oracle.com/webapps/online-help/forms/10g/state?navSetId=_&navId=3&vtTopicFile=enhancedjavabean/enjbs_registerjavabean.html&vtTopicId=
    But I'd opt for a wrapper; you might even want your own class extending PersianCalendar to make some customizing of the calendar.
    cheers

  • How can i execute "*.java " files in Workshop

    Hi,
    Im sunil,new to this weblogic workshop8.1..i dont know how to execute standalone .java files or servlets in workshop.plz help me and tell the way.
    regards
    Budati sunil

    Im not too sure about the Java project. But single normal java files with public static void maain(String [] args) are very simple to execute.
    1. Write the java code somewhere lets call this class A.
    2. Make a dummy page flow.
    3. In the begin action of this pageFlow, call the main method of the A class directly using A.main(null) since main is a static method. your code will work fine.
    4. If you have to pass a String[] as parameters. Before calling main, create this String[] and then pass it.
    In this way you can make a jsp and take the input from the user also.
    Hope it helps
    Cheeers

Maybe you are looking for

  • How is the best way to setup toll bypass

    We have setup toll bypass to save long distance charges. For example if someone calls from Dallas to Houston, they would go through the data network and come out in Houston and go out their local phone lines. I have set this up by getting a list of a

  • CoCd validation in controlling area

    Hi Gurus, I want to activate CoCd validation checkbox in the controlling area using OKKP. This controlling area I want to change is active for some years. When i try to do it, I get a critical warning message although it's possible (because the co.ar

  • Trying to View PDF Doc from IE

    Hi.....recently a couple of machines i administer keep getting the following errors when they click on a link to a pdf doc, Object label badly formatted that is what happens when i try to view the pdf through IE......if i turn that of so it actually

  • Pc Suite via bluetooth getting disconnected on E61...

    Hi, I recently updated to Nokia_PC_Suite_683_rel_14_1_eng_us_web and now I am having troubles when trying to sync. I am getting the message [device name] connected via bluetooth and several seconds later it's getting disconnected with the message: [d

  • My outlook on PC doesn't show message contents or forwarded e-mail

    I can see the e-mail content or forwarded message on my android phone, but not on my pc..My boss can't view them on her laptop either. We don't know what's causing this as we didn't have a problem before...?