Embedding Java Funtion

How can we embed a function or procedure written in Java into a PL/SQL Function, Procedure or Trigger.

It is possible to use the Java Virtual Machine (JVM) in the database. Sometimes this JVM needs to be installed, sometimes it is already present in the database. The Java version is dependent on the version of the Oracle database, you can't change to a higher Java version independently.
In Oracle 11 the JVM has become really fast.
See http://download.oracle.com/docs/cd/B19306_01/java.102/b14187/toc.htm and http://download.oracle.com/docs/cd/B28359_01/java.111/b31225/toc.htm .

Similar Messages

  • Pass the BPEL Input Payload to Embedded Java Program

    Please let me know how can we pass the Input to a BPEL process to the embedded Java Program.
    Requirement:
    To pass the payload recieved by the BPEL process to a Java method using embedded java activity where we can parse/modify this payload
    I tried this approach
    Object obj = (Object)getVariableData('variableName');
    //call to java method with obj as argument
    //In java method
    XMLElement xmlElement = (XMLElement)obj;
    thereafter I am trying to read the nodes of this element but this is not working.
    Please point me to any document/tutorial/examples in this context.
    Thanks

    Hi
    the getVariableData() method returns a org.w3c.dom.Element object (10.1.3 version).
    So I believe you should use something like:
    Object obj = (Object)getVariableData('variableName');
    //call to java method with obj as argument
    //In java method
    org.w3c.dom.Element xmlElement = (org.w3c.dom.Element)obj;
    And to read a node use this:
    org.w3c.dom.Node node = xmlElement.getFirstChild().getNodeValue();
    However I never tried getVariableData('variableName'), I tried getVariableData('variableName','partName','query') so I don´t know the diferences between these two methods, but I hope this helps you.

  • Embedded Java And BPEL

    Hi All
    I need some very urgent help. I had been working on TIBCO and XI till now and in a project currently using Oracle Fusion. I need to query a data from an LDAP service and post a collection of employees into a JMS Queue as an XML. Now I tried using Embedded java to query the LDAP service and that works fine and it returns me the employee details. I have an XSD file that represents how the data needs to be presented. I imported the XSD file into my project and created a variable of element type and chose the schema to be the XSD which I am pasting below. I tried all kinds of ways to populate the data but I always get a selection failure error.
    I then just tried a simple setVariableData method to set the username and again i get the same error. How can I set the variable so that it returns me a collection back. Please help. I am pasting both the XSD as well as the java code that I tried to use. It would be great if someone could let me know what I have done wrong or is there any ways of doing this.
    Thanks so much
    <?xml version="1.0" encoding="windows-1252" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://www.macerich.com/o2c"
    targetNamespace="http://www.macerich.com/o2c"
    elementFormDefault="qualified">
    <xsd:complexType name="LDAPEmployeeType">
    <xsd:sequence>
    <xsd:element name="UserId" type="xsd:string"/>
    <xsd:element name="firstName" type="xsd:string"/>
    <xsd:element name="lastName" type="xsd:string"/>
    <xsd:element name="operation" type="xsd:string"/>
    <xsd:element name="effectiveStartDate" type="xsd:date"/>
    <xsd:element name="effectiveEndDate" type="xsd:date"/>
    <xsd:element name="email" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="LDAPEmployeeCollection">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="LDAPEmployee" type="LDAPEmployeeType" minOccurs="0" maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="Status" type="xsd:string"/>
    </xsd:schema>
    Java Code I have written
    try
    setVariableData("Variable_1","LDAPEmployeeCollection","/ns1:LDAPEmployee/ns1:UserId")
    catch(Exception e)
    setVariableData("Variable_2",e.toString());
    addAuditTrailEntry(e);
    }

    Hi Marc
    I tried what you had suggested but i always get a BPEL error stating a selection failure.
    Im pasting my Java Code here with
    try
    java.util.Hashtable env = new java.util.Hashtable();
    env.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
    env.put(javax.naming.Context.PROVIDER_URL, "ldap://saturn:389");
    env.put(javax.naming.Context.SECURITY_AUTHENTICATION, "simple");
    env.put(javax.naming.Context.SECURITY_PRINCIPAL, "serenecorp\\rmohammed");
    env.put(javax.naming.Context.SECURITY_CREDENTIALS, "s3r3n3!");
    // Create initial context
    javax.naming.directory.DirContext ctx = new javax.naming.directory.InitialDirContext(env);
    //System.out.println(ctx.lookup("OU=Consultants,DC=serenecorp,DC=com "));
    // Specify the ids of the attributes to return
    String[] attrIDs = {"sn", "givenName", "mail", "createTimeStamp"};
    javax.naming.directory.SearchControls ctrls = new javax.naming.directory.SearchControls();
    ctrls.setReturningAttributes(attrIDs);
    // Specify the attributes to match
    //Attributes matchAttrs = new BasicAttributes(true);
    //matchAttrs.put(new BasicAttribute("sAMAccountName", "jale*"));
    String filter = "(&(sAMAccountName=*)(createTimeStamp>=20061116221624.0Z ))";
    //matchAttrs.put(new BasicAttribute("createTimeStamp", "> 20061115221624.0Z"));
    setVariableData("Variable_3","test2");
    // Search for objects that have those matching attributes
    //NamingEnumeration answer = ctx.search("OU=Consultants,DC=serenecorp,DC=com", matchAttrs, attrIDs);
    javax.naming.NamingEnumeration answer = ctx.search("OU=Consultants,DC=serenecorp,DC=com", filter, ctrls);
    javax.xml.parsers.DocumentBuilderFactory domFactory = null;
         javax.xml.parsers.DocumentBuilder domBuilder = null;
         domFactory = javax.xml.parsers.DocumentBuilderFactory.newInstance();
    domBuilder = domFactory.newDocumentBuilder();
         org.w3c.dom.Document newDoc = domBuilder.newDocument();
         org.w3c.dom.Element rootElement = newDoc.createElement("LDAPEmployeeCollection");
    rootElement.setAttributeNS("ns1","ns1","http://www.macerich.com/o2c");
    newDoc.appendChild(rootElement);
    while (answer.hasMore())
    setVariableData("Variable_3","test3");
    javax.naming.directory.SearchResult sr = (javax.naming.directory.SearchResult)answer.next();
    System.out.println(">>>" + sr.getName());
              javax.naming.directory.Attributes attrs = sr.getAttributes();
    if (attrs == null)
    System.out.println("No attributes");
              else
    org.w3c.dom.Element rowElement = newDoc.createElement("LDAPEmployeeType");
    rowElement.setAttributeNS("ns1","ns1","http://www.macerich.com/o2c");
                   /* Print each attribute */
                   for (javax.naming.NamingEnumeration ae = attrs.getAll(); ae.hasMore();)
    javax.naming.directory.Attribute attr = (javax.naming.directory.Attribute)ae.next();
    String id =attr.getID().toString();
    if(id.equals("sn"))
    id = "UserId";
    else if(id.equals("givenName"))
    id ="firstName";
    else if(id.equals("mail"))
    id ="email";
    else if(id.equals("createTimeStamp"))
    id="effectiveStartDate";
    System.out.println("attribute: " + attr.getID());
    System.out.println("Value: " + attr.get());
    org.w3c.dom.Element curElement = newDoc.createElement(id);
    curElement.appendChild(newDoc.createTextNode(attr.get().toString()));
    rowElement.appendChild(curElement);
    setVariableData("Variable_3","test4");
    rootElement.appendChild(rowElement);
    // Print the answer
    //printSearchEnumeration(answer);
    javax.xml.transform.TransformerFactory tranFactory = javax.xml.transform.TransformerFactory.newInstance();
    javax.xml.transform.Transformer aTransformer = tranFactory.newTransformer();
         javax.xml.transform.Source src = new javax.xml.transform.dom.DOMSource(newDoc);
    javax.xml.transform.Result dest = new javax.xml.transform.stream.StreamResult(new java.io.File("c:/test.xml"));
    aTransformer.transform(src, dest);
    org.w3c.dom.NodeList nl = newDoc.getElementsByTagName("LDAPEmployeeCollection");
    org.w3c.dom.Node nd = nl.item(0);
    System.out.println("XML---"+rootElement.toString());
    setVariableData("Variable_1","LDAPEmployeeCollection",newDoc);
    // Close the context when we're done
    ctx.close();
    catch (Exception e)
    setVariableData("Variable_3",e.toString());
    addAuditTrailEntry(e);
    I tried numerous things and today is the final day for my code completion. So i am in a bit of trouble. I just cant figure out what I have done wrong here. I have created a DOM document as you had suggested and then done a setVariableData onto the Variable_1 that i had created selecting the xsd that I had pasted in my previous post as the schema for the variable. I have the namespace set corretly as well. Any suggestions.
    Thanks so much in advance
    Message was edited by:
    user593748

  • Unable to call Java class method within Embedding Java Activity in BPEL

    Hi ,
    I have written Java Class named 'Class3' .
    When I am creating and trying to call these classes whithin Embedding Java Activity , compile time error is coming. Compiler is not finding class . Error message is like this one.
    uildfile: C:\Oracle\Middleware\jdeveloper\bin\ant-sca-compile.xml
    scac:
    [scac] Validating composite : 'C:\JDeveloper\mywork\Application7\Embedded15\composite.xml'
    [scac] C:\JDeveloper\mywork\Application7\Embedded15\SCA-INF\bpel\BPELEmbedded15\src\orabpel\bpelembedded15\ExecLetBxExe0.java:73: cannot find symbol
    [scac] symbol : class Class3
    [scac] location: class orabpel.bpelembedded15.ExecLetBxExe0
    [scac] C:\JDeveloper\mywork\Application7\Embedded15\SCA-INF\bpel\BPELEmbedded15\src\orabpel\bpelembedded15\ExecLetBxExe0.java:73: cannot find symbol
    [scac] symbol : class Class3
    [scac] location: class orabpel.bpelembedded15.ExecLetBxExe0
    [scac] Note: C:\JDeveloper\mywork\Application7\Embedded15\SCA-INF\bpel\BPELEmbedded15\src\orabpel\bpelembedded15\BPEL_BIN.java uses unchecked or unsafe operations.
    [scac] Note: Recompile with -Xlint:unchecked for details.
    [scac] FATAL_ERROR: location {ns:composite/ns:component[@name='BPELEmbedded15']}(20,36): Failed to compile bpel generated classes.
    [scac] failure to compile the generated BPEL classes for BPEL process "BPELEmbedded15" of composite "default/Embedded15!1.0"
    [scac] The class path setting is incorrect.
    [scac] Ensure that the class path is set correctly. If this happens on the server side, verify that the custom classes or jars which this BPEL process is depending on are deployed correctly. Also verify that the run time is using the same release/version.
    [scac]
    BUILD FAILED
    C:\Oracle\Middleware\jdeveloper\bin\ant-sca-compile.xml:264: Java returned: 1 Check log file : C:\JDeveloper\mywork\Application7\Embedded15\SCA-INF\classes\scac.log for errors
    Total time: 8 seconds
    I am creating Class3 directly in Application Resources folder indide Project Folder in Jdeveloper without creating any package. Code of the class is .......
    public class Class3 {
    public Class3() {
    super();
    public String getValue(){
    return "BBBBBBB";
    Can any one help?
    Regards
    Yogendra Rishishwar
    9867927087

    Hi ,
    In your java project frm jdev..right click and choose general and then choose deployment profiles and then choose Jar ..and then give some appropriate name(abc) and then click ok.
    Then under resources file u get a abc.deploy file right click and say deploy to jar ..u will find the jar in that director.Now include this jar in your prjct libraries.
    have a look at the link http://niallcblogs.blogspot.com/search/label/embedded%20Java

  • ORABPEL-05250 - Deployment error after embedding java code

    hi i am getting the following error when deploying my composite i added embedded java and imported the necessary classes i think but if i take the embedded java out it deploys succsefully :
    [09:17:17 PM] Received HTTP response from the server, response code=500
    [09:17:17 PM] Error deploying archive sca_getPickFile_rev1.0.jar to partition "default" on server SANDPIT_SOA
    [09:17:17 PM] HTTP error code returned [500]
    [09:17:17 PM] Error message from server:
    There was an error deploying the composite on SANDPIT_SOA: Error occurred during deployment of component: processGetPckFile to service engine: implementation.bpel, for composite: getPickFile: ORABPEL-05250
    Error deploying BPEL suitcase.
    error while attempting to deploy the BPEL component file "/u01/oracle/FSOAS/product/fmw/user_projects/domains/FSOAS_domain/servers/SANDPIT_SOA/dc/soa_e76b434b-6704-4820-b544-ad56277e0fd9"; the exception reported is: java.lang.RuntimeException: failed to compile execlets of processGetPckFile
    This error contained an exception thrown by the underlying deployment module.
    Verify the exception trace in the log (with logging level set to debug mode).
    [09:17:17 PM] Check server log for more details.
    [09:17:17 PM] Error deploying archive sca_getPickFile_rev1.0.jar to partition "default" on server SANDPIT_SOA
    [09:17:17 PM] #### Deployment incomplete. ####
    [09:17:17 PM] Error deploying archive file:/C:/JDeveloper/mywork/pdfService/getPickFile/deploy/sca_getPickFile_rev1.0.jar
    (oracle.tip.tools.ide.fabric.deploy.common.SOARemoteDeployer)

    Hi
    some times this error comes if the Packages for using JAVA are not i mported into BPEL Weused to get same error but after importing the packages the error usually used to be solved please check whether if the class files which you are using are correctly imported or not
    ex
    <import location="java.util.Properties"
    importType="http://schemas.oracle.com/bpel/extension/java"/>
    <import location="java.io.*"
    importType="http://schemas.oracle.com/bpel/extension/java"/>

  • Error while embedding java into BPEL

    Hi Guys,
    I am getting the following error while embedding Java into BPEL.
    Error: C:\unzipjdev\jdev\system\oracle.j2ee.10.1.3.41.57\embedded-oc4j\.client (The system cannot find the file specified)
    i checked for .client content , it is not available in the directory.
    Does anybody know about this?

    could you please provide the java exec code snippet that you use in bpel? there is a sample under samples/references/JavaExec

  • TopLink, Netbeans 7.4 with embedded Java DB

    Hi,
    I need some guidance please as I'm new to this subject.
    I'm building a Java SE application of a catalogue of music albums and I've looked at the few tutorials (specific to NetBeans) about data binding and TopLink Essentials. However, none of the tutorials work when I try to bind data from an embedded Java DB database table to a Swing JTable.
    The version of TopLink Essentials is TopLink_101340. In the library, which I had to create in NB 7.4, I've included the toplink-essentials.jar and toplink-essentials-agent.jar. The JPA that appears in the persistance.xml file is 1.0.
    What am I supposed to be doing? Are there any tutorials for NB 7.4/Java SE/embedded Java DB/TopLink Essentials?
    Many thanks in advance for helpful responses.

    Te Retina display issue is finally fixed in JDK 7u40+. I just installed JDK7u40 and I can confirm that Retina display finally works in Netbeans 7.4.
    Link to JDK7u40: http://download.oracle.com/otn-pub/java/jdk/7u45-b18/jdk-7u45-macosx-x64.dmg

  • Embedded Java in BPEL and exception handling

    Hello everybody,
    i want to use some embedded java code in my BPEL process (bpelx:exec). This code would sometimes throw exceptions. How can i deal with these exceptions to control my BPEL process? I would like, in a sense, to do some catching of java exceptions but at the BPEL level... for example, my java code would throw an exception, that my BPEL process would "catch" and react the way i want. Is it possible to do that?
    Thanks for your help!
    Nicolas

    you need to throw a com.oracle.bpel.client.BPELFault ..
    from the code
    * This class represents a standard fault that may be thrown by the server
    * during run-time. A BPEL fault has defined, minimally, a QName that
    * corresponds to the fault name (there are several standard faults that
    * are supported, please refer to Appendix A - Standard Faults in the BPEL
    * 1.1 specification for a complete list).
    * <p>
    * This class can only be used from within a <code>bpelx:exec</code> activity;
    * the <code>throw</code> activity can be used from BPEL code.
    * <p>
    * Additional information (such as a fault variable) can be passed through
    * as a part. Currently, internal system errors populate error codes and
    * summary messages via parts.
    hth clemens

  • Extracting data from Variable using embedded Java

    I am reading a file from a File Adapter and using a variable to get the File Name. This file is being copied to another folder using File Adapter with the same name.
    Now I want to use this File Name in Embeded Java code to encrypt the file. But I am not able to extract the File Name. I am using the following code;
    String getFileName = (String)getVariableData("FileName_In","inboundHeader","/ns4:InboundFileHeaderType/ns4:fileName");
    When I execute it does not throw any error but does not do anything. Any help would be appreciated.

    Hi,
          apache POI is working, and I have extracted the <b>text</b> in a word document(MSWord <b>2003</b>).
    But it is not working for MS Word <b>2007</b>. ( The client may use any MS Word format)
    I have an other option,
    <b>Word Document -
    (Convert)-----> XML Document -(XML Parser)--
    > Data(Text, images,etc,...)</b>
    I request suggestions and idea on this.
    Thanks,
    Prabhakar.

  • XPathFactory error in embedded Java code

    Hi,
    I'm getting the following error when executing embedded Java code which does an XPath expression. Does anyone know why this is happening? Thanks.
    [2006/03/13 17:55:22] "{http://schemas.oracle.com/bpel/extension}bindingFault" has been thrown. less
    <bindingFault xmlns="http://schemas.oracle.com/bpel/extension">
    <part name="summary">
    <summary>Operation failed!; nested exception is: java.lang.IllegalArgumentException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: No XPathFctory implementation found for the object model: http://java.sun.com/jaxp/xpath/dom</summary>
    </part>
    <part name="detail">
    <detail>java.lang.IllegalArgumentException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: No XPathFctory implementation found for the object model: http://java.sun.com/jaxp/xpath/dom</detail>
    </part>
    </bindingFault>

    Hi,
    Refer the URL :http://help.sap.com/javadocs/pi/SP3/xpi/com/sap/aii/mapping/api/AbstractTransformation.html
    regards,
    ganga

  • Using embedded Java in BPEL 2.0

    I have found a lot of write ups but am having difficulty.
    My problem is a failure to deploy by composite. I get the message below:
    Redeploying on /Farm_soadev_domain/soadev_domain/AdminServer ...
    Redeploying on "/Farm_soadev_domain/soadev_domain/AdminServer" failed!
    There was an error deploying/undeploying composite on AdminServer: Error occurred during deployment of component: formatDate to service engine: implementation.bpel for composite: formatData: ORABPEL-05250
    Error deploying BPEL suitcase.
    error while attempting to deploy the BPEL component file "E:\Oracle\Middleware\user_projects\domains\soadev_domain\servers\AdminServer\dc\soa_c8abc64b-8475-4479-b54b-b36e4f44c37a"; the exception reported is: java.lang.RuntimeException: failed to compile execlets of formatDate
    This error contained an exception thrown by the underlying deployment module.
    Verify the exception trace in the log (with logging level set to debug mode).
    To simplify the issue I have reduced my code snippet to:
    /*Write your java code below e.g.
      System.out.println("Hello, World");
    String testOne = "Hi Mom";
    The embedded section looks like:
        <extensionActivity>
          <bpelx:exec name="decodeBinary" language="java">
            <![CDATA[
    /*Write your java code below e.g. 
      System.out.println("Hello, World");
    String testOne = "Hi Mom";]]>
          </bpelx:exec>
        </extensionActivity>

    I read the blog post here
    Embedding Java in BPEL process
    Based on that I created this test class to help write code:
    The bolded code is the snippet I actually want to implement when I can solve the problem above.
    package com.f17.customfunction;
    import com.collaxa.cube.engine.ext.bpel.v1.nodes.BPELXExecLet;
    public class codeTyper extends BPELXExecLet {
        public codeTyper() {
            super();
        public void exec(){
         // below code gets pasted in here
    String input = (String)getVariableData("testfile");
    oracle.soa.common.util.Base64Decoder Decoder = new oracle.soa.common.util.Base64Decoder(); 
    try { 
    byte[] decodedByteArray = oracle.soa.common.util.Base64Decoder.decode(input.getBytes());
    setVariableData("compANDstore_merge_InputVariable.AusCreditCollection/ns2:AusCredit/ns2:fileData,decodedByteArray",decodedByteArray);
    } catch(Exception e) {
    e.printStackTrace();

  • Embedded Java applet no longer works correctly (works is old FFOX, Goggle Crome, etc.)

    an embedded Java applet pops up a response box with success or failure on a dbms update. With FFOX(32) 8.x and 9.x running on win7 64, the response box is blank but it should always be either Success or Failed.
    This works just fine in older FFox(with XP), Goggle Chrome(win7 64), etc.

    Hi and Welcome to the Forums!
    Anytime random strange behaviors creep in, the first thing to do is a battery pop reboot. With power ON, remove the back cover and pull out the battery. Wait about a minute then replace the battery and cover. Power up and wait patiently through the long reboot -- ~5 minutes. See if things have returned to good operation. Like all computing devices, BB's suffer from memory leaks and such...with a hard reboot being the best cure.
    Best!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Synchronisation and concurrent programming for embedded Java

    Hi,
    I am looking for Informations about Synchronisation of concurrent access to Objekts for embedded Java applications. Are there Design Patterns or for this topic or general for Sync. in embedded Systems? And are there Embedded JVMs, with special Synchronisation for Embedded Java Apps? I am also looking for an Overview of existing Embedded JVMs of the market. Who can help with e.g. Infos, Books, Links and so on?
    Thanks

    [takeshi_fl],
    It is better for you to post this question under the topic "Embedded Java" on this forum website.

  • View Compilation Errors in Embedded Java Activity

    Hi,
    Is there any way to see the compilation errors in the Embedded Java Activity in the BPEL.
    Thanks,
    Ajay

    Hi,
    Exceptions are automatically converted to BPEL faults and thrown back in BPEL.
    But to see some errors , one can use try catch block with audit trail entry in catch block like :
    try {
    catch (Exception e){
    addAuditTrailEntry(e);
    I have not used this so not sure if this will work.
    HTH,
    Ketan

  • Embedded java drawString problem

    who can help to oracle !!!!
    i want create image dynamically:
    drawString mehod:
    command line calls works both linux and XP
    embedded java calls : working on XP . but not working Linux (drawings ok . drawString doesnt effect)
    M.Y.
    thanks.

    dear,
    thanks...
    complete code below
    on XP , 10gR2 db evertything is ok. 326x160 picture and "Sample Text." seen on browser.
    on Oracle Unbrakeble Linux , 11g db 326x160 picture seen on browser but "Sample Text." absent on picture !!!!!
    did you understand?
    can you help me?
    is this bug?
    or programming mistake?
    or configurtion mistake?
    what is problem.????????????
    when write a code standalone
    working properly both XP and Linux.
    Thanks.
    create or replace and compile java source named java1 as
    import java.awt.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import com.sun.image.codec.jpeg.JPEGCodec;
    import com.sun.image.codec.jpeg.JPEGImageEncoder;
    public class MyGraph
    public static byte[] vcanvas (int width ,int height ) throws IOException
    BufferedImage bimage = new BufferedImage(width,height, BufferedImage.TYPE_INT_RGB);
    Graphics g = bimage.createGraphics();
    g.setColor(Color.white);
    g.fillRect(0, 0, width - 1, height - 1);
    g.setColor(Color.red);
    g.drawRect(0,0,width-1,height-1);
    g.setColor(Color.black);
    g.drawRect(2,2,width-3,height-3);
    g.drawString("Sample Text.",10,height/2);
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    JPEGImageEncoder jpeg = JPEGCodec.createJPEGEncoder(baos);
    jpeg.encode(bimage);
    baos.flush();
    baos.close();
    return baos.toByteArray();
    } // MyGraph
    create or replace function javaimage(w number,h number) return varchar2
    as LANGUAGE JAVA name 'MyGraph.vcanvas(int, int) return byte[]';
    create or replace procedure imgXYZ is
    vData varchar2(32767);
    begin
    owa_util.mime_header('image/jpeg', FALSE );
    owa_util.http_header_close;
    vData:=javaimage(326,160);
    htp.prn(vData);
    end;
    http://server:port/schema/imgXYZ
    Edited by: user3968053 on Jan 5, 2011 3:38 PM
    Edited by: user3968053 on Jan 5, 2011 3:38 PM

Maybe you are looking for

  • Jdeveloper 11.1.2.4.0 - EJBModule exception

    After upgrading to Jdeveloper 11.1.2.4.0 ,I am getting the below exception on generating the webservice for a database procedure api. It works fine with the previous version. <Failure occurred in the execution of deployment request with ID '136794437

  • Importing music from shared folder

    I'm currently moving my music to my 2nd Account. (i'm the only user). I also put the .xml file and iTunes library file in the shared folder. Question: what do i need to do to ensure that my songs, playlists get imported correctly?? Thanks!

  • Query Builder for Date

    If (LIKE @Name+ '%') is for searching names in Local Database then what is the Query if we want to find for date

  • Opening a new terminal window always launches X11

    I did an update from Tiger to Leopard yesterday and while most things are fine, I have a peculiar problem, that every time I open terminal, it automatically launches X11 (the terminal window shows xset as the running application in the title bar). An

  • Where do I find how to do parrallax scrolling with DW?

    I see all these neat new graphic features in Muse but can I do same in DW and if so where do I find tutorials or instructions.