Please show how to use UTL_DBWS package?

I've been digging around google but unable to find any or working example using this package. Oracle document is not much help in this. I've install all the necessary file to get this running. I just need a little kick start and if some one have use this before, please help. Here is what I am trying to consume.
----sample wdsl---
<?xml version="1.0" encoding="utf-8" ?>
- <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="sangle" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="sangle" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Web Service to Authenticate and Manage slb_webservice</wsdl:documentation>
- <wsdl:types>
- <s:schema elementFormDefault="qualified" targetNamespace="sangle">
- <s:element name="Authenticate">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="username" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="AuthenticateResponse">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="AuthenticateResult" type="s:boolean" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="GetRecord">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="username" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="name" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="email" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="GetRecordResponse">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetRecordResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="AddUser">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="username" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="name" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="email" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="AddUserResponse">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="AddUserResult" type="s:boolean" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="DeleteUser">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="username" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="DeleteUserResponse">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="DeleteUserResult" type="s:boolean" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="EditUser">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="username" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="name" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="email" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="EditUserResponse">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="EditUserResult" type="s:boolean" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="ReturnName">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="username" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="ReturnNameResponse">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="ReturnNameResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="ReturnEmail">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="username" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="ReturnEmailResponse">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="ReturnEmailResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
- <wsdl:message name="AuthenticateSoapIn">
<wsdl:part name="parameters" element="tns:Authenticate" />
</wsdl:message>
- <wsdl:message name="AuthenticateSoapOut">
<wsdl:part name="parameters" element="tns:AuthenticateResponse" />
</wsdl:message>
- <wsdl:message name="GetRecordSoapIn">
<wsdl:part name="parameters" element="tns:GetRecord" />
</wsdl:message>
- <wsdl:message name="GetRecordSoapOut">
<wsdl:part name="parameters" element="tns:GetRecordResponse" />
</wsdl:message>
- <wsdl:message name="AddUserSoapIn">
<wsdl:part name="parameters" element="tns:AddUser" />
</wsdl:message>
- <wsdl:message name="AddUserSoapOut">
<wsdl:part name="parameters" element="tns:AddUserResponse" />
</wsdl:message>
- <wsdl:message name="DeleteUserSoapIn">
<wsdl:part name="parameters" element="tns:DeleteUser" />
</wsdl:message>
- <wsdl:message name="DeleteUserSoapOut">
<wsdl:part name="parameters" element="tns:DeleteUserResponse" />
</wsdl:message>
- <wsdl:message name="EditUserSoapIn">
<wsdl:part name="parameters" element="tns:EditUser" />
</wsdl:message>
- <wsdl:message name="EditUserSoapOut">
<wsdl:part name="parameters" element="tns:EditUserResponse" />
</wsdl:message>
- <wsdl:message name="ReturnNameSoapIn">
<wsdl:part name="parameters" element="tns:ReturnName" />
</wsdl:message>
- <wsdl:message name="ReturnNameSoapOut">
<wsdl:part name="parameters" element="tns:ReturnNameResponse" />
</wsdl:message>
- <wsdl:message name="ReturnEmailSoapIn">
<wsdl:part name="parameters" element="tns:ReturnEmail" />
</wsdl:message>
- <wsdl:message name="ReturnEmailSoapOut">
<wsdl:part name="parameters" element="tns:ReturnEmailResponse" />
</wsdl:message>
- <wsdl:portType name="Mini_x0020_PassportSoap">
- <wsdl:operation name="Authenticate">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Method to Authenticate slb_webservice</wsdl:documentation>
<wsdl:input message="tns:AuthenticateSoapIn" />
<wsdl:output message="tns:AuthenticateSoapOut" />
</wsdl:operation>
- <wsdl:operation name="GetRecord">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Method to response with sqlStr</wsdl:documentation>
<wsdl:input message="tns:GetRecordSoapIn" />
<wsdl:output message="tns:GetRecordSoapOut" />
</wsdl:operation>
- <wsdl:operation name="AddUser">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Method to Add User</wsdl:documentation>
<wsdl:input message="tns:AddUserSoapIn" />
<wsdl:output message="tns:AddUserSoapOut" />
</wsdl:operation>
- <wsdl:operation name="DeleteUser">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Method to Delete User</wsdl:documentation>
<wsdl:input message="tns:DeleteUserSoapIn" />
<wsdl:output message="tns:DeleteUserSoapOut" />
</wsdl:operation>
- <wsdl:operation name="EditUser">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Method to Edit User Information</wsdl:documentation>
<wsdl:input message="tns:EditUserSoapIn" />
<wsdl:output message="tns:EditUserSoapOut" />
</wsdl:operation>
- <wsdl:operation name="ReturnName">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Method to Obtain User Name</wsdl:documentation>
<wsdl:input message="tns:ReturnNameSoapIn" />
<wsdl:output message="tns:ReturnNameSoapOut" />
</wsdl:operation>
- <wsdl:operation name="ReturnEmail">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Method to obtain User Email Address</wsdl:documentation>
<wsdl:input message="tns:ReturnEmailSoapIn" />
<wsdl:output message="tns:ReturnEmailSoapOut" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="Mini_x0020_PassportSoap" type="tns:Mini_x0020_PassportSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="Authenticate">
<soap:operation soapAction="sangle/Authenticate" style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="GetRecord">
<soap:operation soapAction="sangle/GetRecord" style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="AddUser">
<soap:operation soapAction="sangle/AddUser" style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="DeleteUser">
<soap:operation soapAction="sangle/DeleteUser" style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="EditUser">
<soap:operation soapAction="sangle/EditUser" style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="ReturnName">
<soap:operation soapAction="sangle/ReturnName" style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="ReturnEmail">
<soap:operation soapAction="sangle/ReturnEmail" style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:binding name="Mini_x0020_PassportSoap12" type="tns:Mini_x0020_PassportSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="Authenticate">
<soap12:operation soapAction="sangle/Authenticate" style="document" />
- <wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="GetRecord">
<soap12:operation soapAction="sangle/GetRecord" style="document" />
- <wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="AddUser">
<soap12:operation soapAction="sangle/AddUser" style="document" />
- <wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="DeleteUser">
<soap12:operation soapAction="sangle/DeleteUser" style="document" />
- <wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="EditUser">
<soap12:operation soapAction="sangle/EditUser" style="document" />
- <wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="ReturnName">
<soap12:operation soapAction="sangle/ReturnName" style="document" />
- <wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="ReturnEmail">
<soap12:operation soapAction="sangle/ReturnEmail" style="document" />
- <wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="Mini_x0020_Passport">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Web Service to Authenticate and Manage slb_webservice</wsdl:documentation>
- <wsdl:port name="Mini_x0020_PassportSoap" binding="tns:Mini_x0020_PassportSoap">
<soap:address location="http://sangle-l-ofs.nam.slb.com/webserv/miniPassport.asmx" />
</wsdl:port>
- <wsdl:port name="Mini_x0020_PassportSoap12" binding="tns:Mini_x0020_PassportSoap12">
<soap12:address location="http://sangle-l-ofs.nam.slb.com/webserv/miniPassport.asmx" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
----end----
Here is my function
----begin copy/paste---
CREATE OR REPLACE FUNCTION CONCUR_ADMIN.slb_webserv_call (p_stock_code IN VARCHAR2)
RETURN VARCHAR2
AS
l_service UTL_DBWS.service;
l_call UTL_DBWS.call;
l_result ANYDATA;
l_wsdl_url VARCHAR2(1024);
l_service_name VARCHAR2(200);
l_operation_name VARCHAR2(200);
l_input_params UTL_DBWS.anydata_list;
BEGIN
l_wsdl_url := 'http://sangle-l-ofs.nam.slb.com/webserv/miniPassport.asmx';
l_service_name := 'Mini_x0020_Passport';
l_operation_name := 'ReturnEmail';
l_service := UTL_DBWS.create_service (
wsdl_document_location => URIFACTORY.getURI(l_wsdl_url),
service_name => l_service_name);
l_call := UTL_DBWS.create_call (
service_handle => l_service,
port_name => NULL,
operation_name => l_operation_name);
l_input_params(1) := ANYDATA.ConvertVarchar2(p_stock_code);
l_result := UTL_DBWS.invoke (
call_handle => l_call,
input_params => l_input_params);
UTL_DBWS.release_call (call_handle => l_call);
UTL_DBWS.release_service (service_handle => l_service);
RETURN ANYDATA.AccessNumber(l_result);
EXCEPTION
WHEN OTHERS THEN
RETURN NULL;
END;
---end----
This is my first experience with SOAP so please be gentle. Thanks.

I am implying that there is documentation in Metalink about the UTL_DBWS package and that it is in Metalink Note given above.
Since you asked, I now assume that you do not have access to Oracle's Support site called Metalink. If not, perhaps you could ask your colleagues to extract that note for you.

Similar Messages

  • Error while using UTL_DBWS package

    Hello
    I want to call a web service using UTL_DBWS package as explained in this link.
    http://www.oracle-base.com/articles/10g/utl_dbws10g.php
    I implemented the example successfully, and I need to my own web service.
    my web service is just a java class that return a hello world and a parameter. deployed on Integrated weblogic server shipped with Jdeveloper11g.
    here is my java class
    package ws;
    import javax.jws.Oneway;
    import javax.jws.WebMethod;
    import javax.jws.WebParam;
    import javax.jws.WebService;
    @WebService
    public class HelloWorld {
        public HelloWorld() {
        @WebMethod(action = "http://ws//sayHelloWorld")
        public String sayHelloWorld(){
            return "Hello World";
        @WebMethod(action = "http://ws//sayHelloWorld")
        public String sayHelloName(@WebParam(name = "arg0")
            String n){
            return "Hello " + n;
    }my WSDL is
      <?xml version="1.0" encoding="UTF-8" ?>
    - <!--  Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Oracle JAX-WS 2.1.5.
      -->
    - <!--  Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Oracle JAX-WS 2.1.5.
      -->
    - <definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://ws/" name="HelloWorldService">
    - <types>
    - <xsd:schema>
      <xsd:import namespace="http://ws/" schemaLocation="http://127.0.0.1:7101/Application15-Model-context-root/HelloWorldPort?xsd=1" />
      </xsd:schema>
      </types>
    - <message name="sayHelloWorld">
      <part name="parameters" element="tns:sayHelloWorld" />
      </message>
    - <message name="sayHelloWorldResponse">
      <part name="parameters" element="tns:sayHelloWorldResponse" />
      </message>
    - <message name="sayHelloName">
      <part name="parameters" element="tns:sayHelloName" />
      </message>
    - <message name="sayHelloNameResponse">
      <part name="parameters" element="tns:sayHelloNameResponse" />
      </message>
    - <portType name="HelloWorld">
    - <operation name="sayHelloWorld">
      <input message="tns:sayHelloWorld" />
      <output message="tns:sayHelloWorldResponse" />
      </operation>
    - <operation name="sayHelloName">
      <input message="tns:sayHelloName" />
      <output message="tns:sayHelloNameResponse" />
      </operation>
      </portType>
    - <binding name="HelloWorldPortBinding" type="tns:HelloWorld">
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
    - <operation name="sayHelloWorld">
      <soap:operation soapAction="http://ws//sayHelloWorld" />
    - <input>
      <soap:body use="literal" />
      </input>
    - <output>
      <soap:body use="literal" />
      </output>
      </operation>
    - <operation name="sayHelloName">
      <soap:operation soapAction="http://ws//sayHelloWorld" />
    - <input>
      <soap:body use="literal" />
      </input>
    - <output>
      <soap:body use="literal" />
      </output>
      </operation>
      </binding>
    - <service name="HelloWorldService">
    - <port name="HelloWorldPort" binding="tns:HelloWorldPortBinding">
      <soap:address location="http://127.0.0.1:7101/Application15-Model-context-root/HelloWorldPort" />
      </port>
      </service>
      </definitions>and my function is to call the web service
    CREATE OR REPLACE FUNCTION SAYHelloMYNAME (p_int_1 IN Varchar2)
      RETURN NUMBER
    AS
      l_service          UTL_DBWS.service;
      l_call                 UTL_DBWS.call;
      l_wsdl_url         VARCHAR2(32767);
      l_namespace        VARCHAR2(32767);
      l_service_qname    UTL_DBWS.qname;
      l_port_qname       UTL_DBWS.qname;
      l_operation_qname  UTL_DBWS.qname;
      l_xmltype_in        XMLTYPE;
      l_xmltype_out       XMLTYPE;
      l_return          VARCHAR2(100);
    BEGIN
      l_wsdl_url        := 'http://127.0.0.1:7101/Application15-Model-context-root/HelloWorldPort?wsdl';
      l_namespace       := 'http://ws/';
      l_service_qname   := UTL_DBWS.to_qname(l_namespace, 'HelloWorldService');
      l_port_qname      := UTL_DBWS.to_qname(l_namespace, 'HelloWorldPort');
      l_operation_qname := UTL_DBWS.to_qname(l_namespace, 'sayHelloName');
       l_service := UTL_DBWS.create_service (
        wsdl_document_location => URIFACTORY.getURI(l_wsdl_url),
        service_name           => l_service_qname);
      l_call := UTL_DBWS.create_call (
        service_handle => l_service,
        port_name      => l_port_qname,
        operation_name => l_operation_qname);
      l_xmltype_in :=  XMLTYPE('<?xml version="1.0" encoding="utf-8"?>
        <sayHelloWorld xmlns="' || l_namespace || '">
          <parameters>' || p_int_1 || '</parameters>
          </sayHelloWorld>');
      l_xmltype_out := UTL_DBWS.invoke(call_Handle => l_call,
                                       request     => l_xmltype_in);
      UTL_DBWS.release_call (call_handle => l_call);
      UTL_DBWS.release_service (service_handle => l_service);
      l_return := l_xmltype_out.extract('//return/text()').getstringVal();
      RETURN l_return;
    END;
    /but when I test the function I get this error
    ORA-29532: Java call terminated by uncaught Java exception: java.lang.IllegalAccessException: error.build.wsdl.model: oracle.j2ee.ws.common.tools.api.WsdlValidationException: Failed to read wsdl file at: "http://127.0.0.1:7101/Application15-Model-context-root/HelloWorldPort?wsdl", caused by: java.net.ConnectException.    : Connection refused
    ORA-06512: at "WSUSER.UTL_DBWS", line 193
    ORA-06512: at "WSUSER.UTL_DBWS", line 190
    ORA-06512: at "WSUSER.SAYHELLOMYNAME", line 24any suggestions?

    M.Jabr wrote:
    can you elaborate more on this?
    I can open http://127.0.0.1:7101/Application15-Model-context-root/HelloWorldPort?wsdl
    on my browser.Is your browser on that Oracle server? You are instructing Oracle server code (the UTL_DBWS package) to access that URL.
    The IP in that URL is a localhost IP address - and that means using the local IP stack only. So it expects a web server on the Oracle server platform on tcp port 7101. It cannot use that IP to access your client/development machine.
    How can I test it using UTL_HTTP?You can write a basic web browser, minus the rendering engine, using UTL_HTTP. You can also use it for web service calls - which is my preference as I deem the UTL_DBWS package to clunky and complex.
    See:
    {message:id=1925297} (sample PL/SQL web browser)
    {message:id=4205205} (sample PL/SQL web browser SOAP call)

  • How to use utl_ftp package to transfer files from one system to another

    Hi all,
    How to use utl_ftp package to transfer files from one system to another using plsql procedure .
    I failed to find the appropriate document ,kindly help me .
    Thanks,
    P Prakash

    prakash wrote:
    I am sorry tell you, this blog is not enough to for me.It's not a blog, it's Chris' website where you download the package from. Once you download the package and unrar it, then the package spec gives instructions (and I think there's instructions on how to install it too).
    Kindly let me know if there is any oracle documentation for this .It's not an Oracle created package, it was created by Chris. It's based around the UTL_TCP package if you really want to get into the nitty gritty of how it works, but I don't think you do.

  • How to use the Packager for iPhone ?

    Hi What`s up guys??
    I Download the Packager for iPhone and i can`t used this ?
    please help me and show me in picture how to use this.

    my question about http://labs.adobe.com/technologies/packagerforiphone/ package.

  • How to use Salary packaging in ESS...?

    Hi All,
    We are using ESS 1.0, Webdynpro 600 (EP 7.0).
    Is there any standard service for Salary packaging compare (employee perspective) to re-structure his salary components ?
    I found tcode : P16B in ECC 6.0.
    But I donno how to use and customize it. Please shade some light regarding the same...... what are prerequisites for this tcode ?
    Looking forward to your responses. Appreciate your help in advance. Usefull answers would be rewarded full points.
    Regards,
    Anil Kumar

    Hi Sakti,
    We are using India Country Grouping - 40.
    When I enter the tcode - p16b from end user;s logon, it says transaction cannot be performed.
    Please let me know your inputs for the same.
    Regards,
    Anil Kumar

  • Need a Big Help please on how to use getAppletContext() method

    I have three classes, first one extends JApplet, second class I use two create my popup menus, third class I use for my main actions to be done. I need when a popup menu is clicked to load a page, but I am getting this error.
    java.lang.NullPointerException
    at java.applet.Applet.getAppletContext(Applet.java:171)
    at Popup_Menus$1.actionPerformed(Popup_Menus.java:90)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
    at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:289)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1113)
    at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:943)
    at java.awt.Component.processMouseEvent(Component.java:5134)
    at java.awt.Component.processEvent(Component.java:4931)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3639)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3480)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
    at java.awt.Container.dispatchEventImpl(Container.java:1609)
    at java.awt.Component.dispatchEvent(Component.java:3480)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Ev
    My Code is messy, but here it is: -
    Class One
    //package final_project;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.sql.*;
    import java.util.*;
    import java.io.*;
    import java.applet.*;
    import java.net.*;
    public class Main_Interface extends JApplet implements Runnable {
    GUICanvas MainCanvas;
    int counter = 0;
    protected int delay = 10000;
    private Thread timeThread= null;
         public void init() {
         Container contentPane = getContentPane();
    MainCanvas = new GUICanvas();
    contentPane.setBounds(0,0,850,650);
         contentPane.add(MainCanvas);
    public void start() {
    timeThread = new Thread(this);
    timeThread.start();
    public void run() {
    Thread myThread = Thread.currentThread();
    while (timeThread == myThread) {
    try {
    Thread.currentThread().sleep(delay);
    } catch (InterruptedException e){}
    counter ++;
    MainCanvas.TheKing();
    Class Two
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.sql.*;
    import java.util.*;
    import java.io.*;
    import java.applet.*;
    import java.net.*;
    import java.applet.*;
    public class Popup_Menus extends Applet implements MouseListener {
    JPopupMenu ar[] = new JPopupMenu[16];
    JMenuItem it[] = new JMenuItem[84];
    public Popup_Menus() {
    for (int i=0;i<16;i++)
    ar[i] = new JPopupMenu();
    for (int i=0;i<84;i++)
    it[i] = new JMenuItem();
    it.setBackground(Color.orange);
    it[i].setForeground(Color.cyan);
    it[16]= new JMenuItem("Shop Details");
    it[17]= new JMenuItem("NoOfStaff");
    it[18]= new JMenuItem("ShopAssest");
    it[0] = new JMenuItem("Oracle");
    ar[0].add(it[0]);
    it[1] = new JMenuItem("Macrosoft");
    ar[1].add(it[1]);
    it[2] = new JMenuItem("SunMicro");
    ar[2].add(it[2]);
    it[3] = new JMenuItem("PeopleSoft");
    ar[3].add(it[3]);
    it[4] = new JMenuItem("HP");
    ar[4].add(it[4]);
    it[5] = new JMenuItem("Dell");
    ar[5].add(it[5]);
    it[6] = new JMenuItem("Compact");
    ar[6].add(it[6]);
    it[7] = new JMenuItem("Apple");
    ar[7].add(it[7]);
    it[8] = new JMenuItem("Sony");
    ar[8].add(it[8]);
    it[9] = new JMenuItem("Philipes");
    ar[9].add(it[9]);
    it[10] = new JMenuItem("Bush");
    ar[10].add(it[0]);
    it[11] = new JMenuItem("Granada");
    ar[11].add(it[11]);
    it[12] = new JMenuItem("PC");
    ar[12].add(it[12]);
    it[13] = new JMenuItem("Macintosh");
    ar[13].add(it[13]);
    it[14] = new JMenuItem("Laptop");
    ar[14].add(it[14]);
    it[15] = new JMenuItem("Solaris");
    ar[15].add(it[15]);
    it[0].addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent e)
    ar[0].add(it[16]);
    ar[0].add(it[17]);
    ar[0].add(it[18]);
    System.out.println("Working");
    // ma = new Main_Interface();
    try
    System.out.println("menuitem");
    String s="ali";
    URL url = new URL("http://www.google.com");
    getAppletContext().showDocument(url,s);
    catch(MalformedURLException malformedurlexception)
    System.err.println(malformedurlexception);
    public void mouseClicked(java.awt.event.MouseEvent e) {
    //ar[0].show(this,30,30);
    public void mouseEntered(java.awt.event.MouseEvent mouseEvent) {
    public void mouseExited(java.awt.event.MouseEvent mouseEvent) {
    public void mousePressed(java.awt.event.MouseEvent mouseEvent) {
    public void mouseReleased(java.awt.event.MouseEvent mouseEvent) {
    Class Three
    //package final_project;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.sql.*;
    import java.util.*;
    import java.io.*;
    import java.applet.*;
    import java.net.*;
    public class GUICanvas extends JPanel implements MouseMotionListener,ActionListener,MouseListener
    private Color color;
    Popup_Menus popup = new Popup_Menus();
    private Font font;
    double a1, Q = 0,Z = 0,P = 1, S1;
    String Percentages;
    double Aa=0,Ba=0,Ca=0,Da=0;
    double Aa1=0,Ba1=0,Ca1=0,Da1=0;
    double Aa2=0,Ba2=0,Ca2=0,Da2=0;
    double Aa3=0,Ba3=0,Ca3=0,Da3=0;
    double Aa4=0,Ba4=0,Ca4=0,Da4=0;
    double Sum = 0,Sum1 = 0, Sum2 = 0, Sum3 = 0, Sum4 = 0;
    double A=0, B=0, C=0, D=0;
    double A1=0, B1=0, C1=0, D1=0,A2=0, B2=0, C2=0, D2=0;
    double k1=0,k2=0,l1=0,l2=0,r1=0,r2=0,u1=0,u2=0;
    int xpos,ypos,popcounter=0;
    double DC1[] = new double[4];
    double DC2[] = new double[4];
    double DC3[] = new double[4];
    double DC4[] = new double[4];
    boolean rect1Active[] = new boolean[4];
    boolean rect1Active2[] = new boolean[4];
    boolean rect1Active3[] = new boolean[4];
    boolean rect1Active4[] = new boolean[4];
    double DF1[] = new double[4];
    double DF2[] = new double[4];
    double DF3[] = new double[4];
    double DF4[] = new double[4];
    double Ap[] = new double[4];
    double Bp[] = new double[4];
    double Cp[] = new double[4];
    double Dp[] = new double[4];
    int rect1width[] = new int[4];
    int rect1height[] = new int[4];
    int rect1xco[] = new int[4];
    int rect1yco[] = new int[4];
    int rect1width2[] = new int[4];
    int rect1height2[] = new int[4];
    int rect1xco2[] = new int[4];
    int rect1yco2[] = new int[4];
    int rect1width3[] = new int[4];
    int rect1height3[] = new int[4];
    int rect1xco3[] = new int[4];
    int rect1yco3[] = new int[4];
    int rect1width4[] = new int[4];
    int rect1height4[] = new int[4];
    int rect1xco4[] = new int[4];
    int rect1yco4[] = new int[4];
    double rect1width5[] = new double[4];
    double rect1height5[] = new double[4];
    double rect1xco5[] = new double[4];
    double rect1yco5[] = new double[4];
    public GUICanvas() {
    setBackground( Color.black );
    TheKing();
    addMouseListener(this);
    addMouseMotionListener(this);
    public void TheKing()
    double X=740, Y=470, Ap=0,Bp=0,Cp=0,Dp=0;
    String line[] = new String[4];
    /* try {
    URL url = new URL(
         "http://localhost:111/test/servlet/TestServlet");
    BufferedReader in = new BufferedReader(
         new InputStreamReader(url.openStream()));
    for (int i = 0; i<4; i++)
    line[i] = in.readLine();
    in.close();
    }catch (Exception e){
    e.printStackTrace();
    line[0] = "200";
    line[1] = "200";
    line[2] = "200";
    line[3] = "200";
    Aa = s2d(line[0]);
    Ba = s2d(line[1]);
    Ca = s2d(line[2]);
    Da = s2d(line[3]);
    rect1xco5[0] = 20;
    rect1yco5[0] = 20;
    Sum=Aa+Ba+Ca+Da;
    Ap = (Aa/Sum)*100;
    Bp = (Ba/Sum)*100;
    Cp = (Ca/Sum)*100;
    Dp = (Da/Sum)*100;
    A= (Ap/100)*(X*Y);
    B= (Bp/100)*(X*Y);
    C= (Cp/100)*(X*Y);
    D= (Dp/100)*(X*Y);
    Q = ((A*C)+(X*Y*D)+(X*C*Y)+(B*X*Y)-(Y*A*X)-((X*X)*(Y*Y))-(B*D))/((X*(Y*Y))-(Y*D)-(C*Y));
    Z = (((X*X)*Y*A)-(X*C*A)-(B*X*A))/((X*(Y*Y))-(Y*D)-(C*Y));
    A1 =((-Q) + (Math.sqrt((Q*Q)-(4*P*Z))))/(2*P);
    A2=A/A1;
    B1=X-A1;
    B2=B/B1;
    D2=Y-A2;
    D1=D/D2;
    C1=X-D1;
    C2=C/C1;
    S1=B2+C2;
    rect1width5[0] = d2i(A1);
    rect1height5[0] = d2i(A2);
    rect1width5[1] = d2i(B1);
    rect1height5[1] = d2i(B2);
    rect1width5[2] = d2i(D1);
    rect1height5[2] = d2i(D2);
    rect1width5[3] = d2i(C1);
    rect1height5[3] = d2i(C2);
    rect1xco5[1] = rect1xco5[0] + rect1width5[0];
    rect1yco5[1] = rect1xco5[0];
    rect1xco5[2] = rect1xco5[0];
    rect1yco5[2] = rect1yco5[0] + rect1height5[0];
    rect1xco5[3] = rect1xco5[0] + rect1width5[2];
    rect1yco5[3] = rect1yco5[0] + rect1height5[1];
    k1=rect1xco5[0]+rect1width5[0];
    k2=rect1yco5[0]+rect1height5[0];
    l1=rect1width5[1]-20;
    l2=rect1yco5[1]+rect1height5[1];
    r1=rect1xco5[0]+rect1width5[2];
    r2=rect1height5[2]-20;
    u1=rect1width5[3]-20;
    u2=rect1height5[3]-20;
    RegionOne(k1, k2);
    RegionTwo(l1,l2);
    RegionThree(r1, r2);
    RegionFour(u1, u2);
    public void RegionOne(double X1, double Y1)
    String line[] = new String[4];
    /* try {
    URL url = new URL(
         "http://localhost:111/test/servlet/TestServlet1?name=ONE");
    BufferedReader in = new BufferedReader(
         new InputStreamReader(url.openStream()));
    for (int i = 0; i<4; i++)
    line[i] = in.readLine();
    in.close();
    }catch (Exception e){
    e.printStackTrace();
    line[0] = "1200";
    line[1] = "2100";
    line[2] = "1200";
    line[3] = "2100";
    DC1[0] = Aa1 ;
    DC1[1] = Ba1 ;
    DC1[2] = Ca1;
    DC1[3] = Da1;
    Aa1 = s2d(line[0]);
    Ba1 = s2d(line[1]);
    Ca1 = s2d(line[2]);
    Da1 = s2d(line[3]);
    DF1[0] = Aa1 ;
    DF1[1] = Ba1 ;
    DF1[2] = Ca1;
    DF1[3] = Da1;
    rect1xco[0] = 20;
    rect1yco[0] = 20;
    Sum1=Aa1+Ba1+Ca1+Da1;
    Ap[0] = (Aa1/Sum1)*100;
    Bp[0] = (Ba1/Sum1)*100;
    Cp[0] = (Ca1/Sum1)*100;
    Dp[0] = (Da1/Sum1)*100;
    A= (Ap[0]/100)*(X1*Y1);
    B= (Bp[0]/100)*(X1*Y1);
    C= (Cp[0]/100)*(X1*Y1);
    D= (Dp[0]/100)*(X1*Y1);
    Q = ((A*C)+(X1*Y1*D)+(X1*C*Y1)+(B*X1*Y1)-(Y1*A*X1)-((X1*X1)*(Y1*Y1))-(B*D))/((X1*(Y1*Y1))-(Y1*D)-(C*Y1));
    Z = (((X1*X1)*Y1*A)-(X1*C*A)-(B*X1*A))/((X1*(Y1*Y1))-(Y1*D)-(C*Y1));
    A1 =((-Q) + (Math.sqrt((Q*Q)-(4*P*Z))))/(2*P);
    A2=A/A1;
    B1=X1-A1;
    B2=B/B1;
    D2=Y1-A2;
    D1=D/D2;
    C1=X1-D1;
    C2=C/C1;
    S1=B2+C2;
    rect1width[0] = d2i(A1);
    rect1height[0] = d2i(A2);
    rect1width[1] = d2i(B1);
    rect1height[1] = d2i(B2);
    rect1width[2] = d2i(D1);
    rect1height[2] = d2i(D2);
    rect1width[3] = d2i(C1);
    rect1height[3] = d2i(C2);
    rect1xco[1] = rect1xco[0] + rect1width[0];
    rect1yco[1] = rect1xco[0];
    rect1xco[2] = rect1xco[0];
    rect1yco[2] = rect1yco[0] + rect1height[0];
    rect1xco[3] = rect1xco[0] + rect1width[2];
    rect1yco[3] = rect1yco[0] + rect1height[1];
    public void RegionTwo(double X2, double Y2)
    String line[] = new String[4];
    /* try {
    URL url = new URL(
         "http://localhost:111/test/servlet/TestServlet1?name=TWO");
    BufferedReader in = new BufferedReader(
         new InputStreamReader(url.openStream()));
    for (int i = 0; i<4; i++)
    line[i] = in.readLine();
    in.close();
    catch (Exception e){
    e.printStackTrace();
    line[0] = "1200";
    line[1] = "2100";
    line[2] = "1200";
    line[3] = "2100";
    DC2[0] = Aa2;
    DC2[1] = Ba2;
    DC2[2] = Ca2;
    DC2[3] = Da2;
    Aa2 = s2d(line[0]);
    Ba2 = s2d(line[1]);
    Ca2 = s2d(line[2]);
    Da2 = s2d(line[3]);
    DF2[0] = Aa2 ;
    DF2[1] = Ba2 ;
    DF2[2] = Ca2;
    DF2[3] = Da2;
    rect1xco2[0] = rect1xco[1]+rect1width[1];
    rect1yco2[0] = 20;
    Sum2=Aa2+Ba2+Ca2+Da2;
    Ap[1] = (Aa2/Sum2)*100;
    Bp[1] = (Ba2/Sum2)*100;
    Cp[1] = (Ca2/Sum2)*100;
    Dp[1] = (Da2/Sum2)*100;
    A= (Ap[1]/100)*(X2*Y2);
    B= (Bp[1]/100)*(X2*Y2);
    C= (Cp[1]/100)*(X2*Y2);
    D= (Dp[1]/100)*(X2*Y2);
    Q = ((A*C)+(X2*Y2*D)+(X2*C*Y2)+(B*X2*Y2)-(Y2*A*X2)-((X2*X2)*(Y2*Y2))-(B*D))/((X2*(Y2*Y2))-(Y2*D)-(C*Y2));
    Z = (((X2*X2)*Y2*A)-(X2*C*A)-(B*X2*A))/((X2*(Y2*Y2))-(Y2*D)-(C*Y2));
    A1 =((-Q) + (Math.sqrt((Q*Q)-(4*P*Z))))/(2*P);
    A2=A/A1;
    B1=X2-A1;
    B2=B/B1;
    D2=Y2-A2;
    D1=D/D2;
    C1=X2-D1;
    C2=C/C1;
    rect1width2[0] = d2i(A1);
    rect1height2[0] = d2i(A2);
    rect1width2[1] = d2i(B1);
    rect1height2[1] = d2i(B2);
    rect1width2[2] = d2i(D1);
    rect1height2[2] = d2i(D2);
    rect1width2[3] = d2i(C1);
    rect1height2[3] = d2i(C2);
    rect1xco2[1] = rect1xco2[0] + rect1width2[0];
    rect1yco2[1] = rect1yco2[0];
    rect1xco2[2] = rect1xco2[0];
    rect1yco2[2] = rect1yco2[0] + rect1height2[0];
    rect1xco2[3] = rect1xco2[0] + rect1width2[2];
    rect1yco2[3] = rect1yco2[0] + rect1height2[1];
    public void RegionThree(double X3, double Y3)
    String line[] = new String[4];
    /* try {
    URL url = new URL(
         "http://localhost:111/test/servlet/TestServlet1?name=THREE");
    BufferedReader in = new BufferedReader(
         new InputStreamReader(url.openStream()));
    for (int i = 0; i<4; i++)
    line[i] = in.readLine();
    in.close();
    catch (Exception e){
    e.printStackTrace();
    line[0] = "1200";
    line[1] = "2100";
    line[2] = "1200";
    line[3] = "2100";
    DC3[0] = Aa3 ;
    DC3[1] = Ba3 ;
    DC3[2] = Ca3;
    DC3[3] = Da3;
    Aa3 = s2d(line[0]);
    Ba3 = s2d(line[1]);
    Ca3 = s2d(line[2]);
    Da3 = s2d(line[3]);
    DF3[0] = Aa3 ;
    DF3[1] = Ba3;
    DF3[2] = Ca3;
    DF3[3] = Da3;
    rect1xco3[0] = 20;
    rect1yco3[0] = rect1yco[2]+rect1height[2];
    Sum3=Aa3+Ba3+Ca3+Da3;
    Ap[2] = (Aa3/Sum3)*100;
    Bp[2] = (Ba3/Sum3)*100;
    Cp[2] = (Ca3/Sum3)*100;
    Dp[2] = (Da3/Sum3)*100;
    A= (Ap[2]/100)*(X3*Y3);
    B= (Bp[2]/100)*(X3*Y3);
    C= (Cp[2]/100)*(X3*Y3);
    D= (Dp[2]/100)*(X3*Y3);
    Q = ((A*C)+(X3*Y3*D)+(X3*C*Y3)+(B*X3*Y3)-(Y3*A*X3)-((X3*X3)*(Y3*Y3))-(B*D))/((X3*(Y3*Y3))-(Y3*D)-(C*Y3));
    Z = (((X3*X3)*Y3*A)-(X3*C*A)-(B*X3*A))/((X3*(Y3*Y3))-(Y3*D)-(C*Y3));
    A1 =((-Q) + (Math.sqrt((Q*Q)-(4*P*Z))))/(2*P);
    A2=A/A1;
    B1=X3-A1;
    B2=B/B1;
    D2=Y3-A2;
    D1=D/D2;
    C1=X3-D1;
    C2=C/C1;
    rect1width3[0] = d2i(A1);
    rect1height3[0] = d2i(A2);
    rect1width3[1] = d2i(B1);
    rect1height3[1] = d2i(B2);
    rect1width3[2] = d2i(D1);
    rect1height3[2] = d2i(D2);
    rect1width3[3] = d2i(C1);
    rect1height3[3] = d2i(C2);
    rect1xco3[1] = rect1xco3[0] + rect1width3[0];
    rect1yco3[1] = rect1yco[3] + rect1height[3];
    rect1xco3[2] = rect1xco3[0];
    rect1yco3[2] = rect1yco3[0] + rect1height3[0];
    rect1xco3[3] = rect1xco3[0] + rect1width3[2];
    rect1yco3[3] = rect1yco3[0] + rect1height3[1];
    public void RegionFour(double X4, double Y4)
    String line[] = new String[4];
    /*try {
    URL url = new URL(
         "http://localhost:111/test/servlet/TestServlet1?name=FOUR");
    BufferedReader in = new BufferedReader(
         new InputStreamReader(url.openStream()));
    for (int i = 0; i<4; i++)
    line[i] = in.readLine();
    in.close();
    catch (Exception e){
    e.printStackTrace();
    line[0] = "1200";
    line[1] = "2100";
    line[2] = "1200";
    line[3] = "2100";
    DC4[0] = Aa4 ;
    DC4[1] = Ba4 ;
    DC4[2] = Ca4;
    DC4[3] = Da4;
    Aa4 = s2d(line[0]);
    Ba4 = s2d(line[1]);
    Ca4 = s2d(line[2]);
    Da4 = s2d(line[3]);
    DF4[0] = Aa4 ;
    DF4[1] = Ba4 ;
    DF4[2] = Ca4;
    DF4[3] = Da4;
    rect1xco4[0] = rect1xco3[1]+rect1width3[1];
    rect1yco4[0] = rect1yco2[2]+rect1height2[2];
    Sum4=Aa4+Ba4+Ca4+Da4;
    Ap[3] = (Aa4/Sum4)*100;
    Bp[3] = (Ba4/Sum4)*100;
    Cp[3] = (Ca4/Sum4)*100;
    Dp[3] = (Da4/Sum4)*100;
    A= (Ap[3]/100)*(X4*Y4);
    B= (Bp[3]/100)*(X4*Y4);
    C= (Cp[3]/100)*(X4*Y4);
    D= (Dp[3]/100)*(X4*Y4);
    Q = ((A*C)+(X4*Y4*D)+(X4*C*Y4)+(B*X4*Y4)-(Y4*A*X4)-((X4*X4)*(Y4*Y4))-(B*D))/((X4*(Y4*Y4))-(Y4*D)-(C*Y4));
    Z = (((X4*X4)*Y4*A)-(X4*C*A)-(B*X4*A))/((X4*(Y4*Y4))-(Y4*D)-(C*Y4));
    A1 =((-Q) + (Math.sqrt((Q*Q)-(4*P*Z))))/(2*P);
    A2=A/A1;
    B1=X4-A1;
    B2=B/B1;
    D2=Y4-A2;
    D1=D/D2;
    C1=X4-D1;
    C2=C/C1;
    rect1width4[0] = d2i(A1);
    rect1height4[0] = d2i(A2);
    rect1width4[1] = d2i(B1);
    rect1height4[1] = d2i(B2);
    rect1width4[2] = d2i(D1);
    rect1height4[2] = d2i(D2);
    rect1width4[3] = d2i(C1);
    rect1height4[3] = d2i(C2);
    rect1xco4[1] = rect1xco4[0] + rect1width4[0];
    rect1yco4[1] = rect1yco2[2]+rect1height2[2];
    rect1xco4[2] = rect1xco4[0];
    rect1yco4[2] = rect1yco4[0] + rect1height4[0];
    rect1xco4[3] = rect1xco4[0] + rect1width4[2];
    rect1yco4[3] = rect1yco4[0] + rect1height4[1];
    static int d2i(double d) {return (int) Math.round(d);}
    static double i2d(int i) {return (double) i;}
    static double s2d(String s)
    double i=0;
    try{  return i = Double.parseDouble(s);}
    catch(NumberFormatException e)
    {  e.printStackTrace();}
    return i;
    public void paintComponent(Graphics g) {
    super.paintComponent(g);
    int k11=d2i(k1);
    int k21=d2i(k2);
    int l11=d2i(l1);
    int l21=d2i(l2);
    int r11=d2i(r1);
    int r21=d2i(r2);
    int u11=d2i(u1);
    int u21=d2i(u2);
    g.setColor(Color.magenta);
    g.drawRect(rect1xco[0]-2,rect1yco[0]-2,k11+2,k21+2);
    g.drawRect(rect1xco[0]-1,rect1yco[0]-1,k11+2,k21+1);
    g.drawRect(rect1xco2[0]+1,rect1yco2[0]-1,l11+1,l21+1);
    g.drawRect(rect1xco2[0]+1,rect1yco2[0]-2,l11+2,l21+2);
    g.drawRect(rect1xco3[0]-1,rect1yco3[0]+1,r11+2,r21+1);
    g.drawRect(rect1xco3[0]-2,rect1yco3[0]+1,r11+2,r21+2);
    g.drawRect(rect1xco4[0]+1,rect1yco4[0]+1,u11+2,u21+1);
    g.drawRect(rect1xco4[0]+1,rect1yco4[0]+1,u11+1,u21+2);
    g.setColor(Color.cyan);
    g.drawRect(16,16,749,479);
    g.drawRect(17,17,747,477);
    if (rect1Active[0])
    // First Rectangle's coloring of the Region One
    if(DC1[0] == DF1[0])
    g.setColor(Color.black);
    g.fillRect(rect1xco[0]+2,rect1yco[0]+2,rect1width[0]-4,rect1height[0]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco[0],rect1yco[0],rect1width[0]-1,rect1height[0]-1);
    g.drawRect(rect1xco[0]+1,rect1yco[0]+1,rect1width[0]-3,rect1height[0]-3);
    else if(DC1[0] > DF1[0])
    g.setColor(Color.red);
    g.fillRect(rect1xco[0]+2,rect1yco[0]+2,rect1width[0]-4,rect1height[0]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco[0],rect1yco[0],rect1width[0]-1,rect1height[0]-1);
    g.drawRect(rect1xco[0]+1,rect1yco[0]+1,rect1width[0]-3,rect1height[0]-3);
    else if(DC1[0] < DF1[0])
    g.setColor(Color.green);
    g.fillRect(rect1xco[0]+2,rect1yco[0]+2,rect1width[0]-4,rect1height[0]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco[0],rect1yco[0],rect1width[0]-1,rect1height[0]-1);
    g.drawRect(rect1xco[0]+1,rect1yco[0]+1,rect1width[0]-3,rect1height[0]-3);
    else
    if(DC1[0] == DF1[0])
    g.setColor(Color.black);
    g.fillRect(rect1xco[0],rect1yco[0],rect1width[0],rect1height[0]);
    else if(DC1[0] > DF1[0])
    g.setColor(Color.red);
    g.fillRect(rect1xco[0],rect1yco[0],rect1width[0],rect1height[0]);
    else if(DC1[0] < DF1[0])
    g.setColor(Color.green);
    g.fillRect(rect1xco[0],rect1yco[0],rect1width[0],rect1height[0]);
    if (rect1Active[1])
    // Second Rectangle's coloring of the Region One
    if(DC1[1] == DF1[1])
    g.setColor(Color.black);
    g.fillRect(rect1xco[1]+2,rect1yco[1]+2,rect1width[1]-4,rect1height[1]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco[1],rect1yco[1],rect1width[1]-1,rect1height[1]-1);
    g.drawRect(rect1xco[1]+1,rect1yco[1]+1,rect1width[1]-3,rect1height[1]-3);
    else if(DC1[1] > DF1[1])
    g.setColor(Color.red);
    g.fillRect(rect1xco[1]+2,rect1yco[1]+2,rect1width[1]-4,rect1height[1]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco[1],rect1yco[1],rect1width[1]-1,rect1height[1]-1);
    g.drawRect(rect1xco[1]+1,rect1yco[1]+1,rect1width[1]-3,rect1height[1]-3);
    else if(DC1[1] < DF1[1])
    g.setColor(Color.green);
    g.fillRect(rect1xco[1]+2,rect1yco[1]+2,rect1width[1]-4,rect1height[1]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco[1],rect1yco[1],rect1width[1]-1,rect1height[1]-1);
    g.drawRect(rect1xco[1]+1,rect1yco[1]+1,rect1width[1]-3,rect1height[1]-3);
    else
    if(DC1[1] == DF1[1])
    g.setColor(Color.black);
    g.fillRect(rect1xco[1],rect1yco[1],rect1width[1],rect1height[1]);
    else if(DC1[1] > DF1[1])
    g.setColor(Color.red);
    g.fillRect(rect1xco[1],rect1yco[1],rect1width[1],rect1height[1]);
    else if(DC1[1] < DF1[1])
    g.setColor(Color.green);
    g.fillRect(rect1xco[1],rect1yco[1],rect1width[1],rect1height[1]);
    if (rect1Active [2])
    // Third Rectangle's coloring of the Region One
    if(DC1[2] == DF1[2])
    g.setColor(Color.black);
    g.fillRect(rect1xco[2]+2,rect1yco[2]+2,rect1width[2]-4,rect1height[2]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco[2],rect1yco[2],rect1width[2]-1,rect1height[2]-1);
    g.drawRect(rect1xco[2]+1,rect1yco[2]+1,rect1width[2]-3,rect1height[2]-3);
    else if(DC1[2] > DF1[2])
    g.setColor(Color.red);
    g.fillRect(rect1xco[2]+2,rect1yco[2]+2,rect1width[2]-4,rect1height[2]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco[2],rect1yco[2],rect1width[2]-1,rect1height[2]-1);
    g.drawRect(rect1xco[2]+1,rect1yco[2]+1,rect1width[2]-3,rect1height[2]-3);
    else if(DC1[2] < DF1[2])
    g.setColor(Color.green);
    g.fillRect(rect1xco[2]+2,rect1yco[2]+2,rect1width[2]-4,rect1height[2]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco[2],rect1yco[2],rect1width[2]-1,rect1height[2]-1);
    g.drawRect(rect1xco[2]+1,rect1yco[2]+1,rect1width[2]-3,rect1height[2]-3);
    else
    if(DC1[2] == DF1[2])
    g.setColor(Color.black);
    g.fillRect(rect1xco[2],rect1yco[2],rect1width[2],rect1height[2]);
    else if(DC1[2] > DF1[2])
    g.setColor(Color.red);
    g.fillRect(rect1xco[2],rect1yco[2],rect1width[2],rect1height[2]);
    else if(DC1[2] < DF1[2])
    g.setColor(Color.green);
    g.fillRect(rect1xco[2],rect1yco[2],rect1width[2],rect1height[2]);
    if (rect1Active [3])
    //Fourth Rectangle's coloring of the Region One
    if(DC1[3] == DF1[3])
    g.setColor(Color.black);
    g.fillRect(rect1xco[3]+2,rect1yco[3]+2,rect1width[3]-4,rect1height[3]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco[3],rect1yco[3],rect1width[3]-1,rect1height[3]-1);
    g.drawRect(rect1xco[3]+1,rect1yco[3]+1,rect1width[3]-3,rect1height[3]-3);
    else if(DC1[3] > DF1[3])
    g.setColor(Color.red);
    g.fillRect(rect1xco[3]+2,rect1yco[3]+2,rect1width[3]-4,rect1height[3]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco[3],rect1yco[3],rect1width[3]-1,rect1height[3]-1);
    g.drawRect(rect1xco[3]+1,rect1yco[3]+1,rect1width[3]-3,rect1height[3]-3);
    else if(DC1[3] < DF1[3])
    g.setColor(Color.green);
    g.fillRect(rect1xco[3]+2,rect1yco[3]+2,rect1width[3]-4,rect1height[3]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco[3],rect1yco[3],rect1width[3]-1,rect1height[3]-1);
    g.drawRect(rect1xco[3]+1,rect1yco[3]+1,rect1width[3]-3,rect1height[3]-3);
    else
    if(DC1[3] == DF1[3])
    g.setColor(Color.black);
    g.fillRect(rect1xco[3],rect1yco[3],rect1width[3],rect1height[3]);
    else if(DC1[3] > DF1[3])
    g.setColor(Color.red);
    g.fillRect(rect1xco[3],rect1yco[3],rect1width[3],rect1height[3]);
    else if(DC1[3] < DF1[3])
    g.setColor(Color.green);
    g.fillRect(rect1xco[3],rect1yco[3],rect1width[3],rect1height[3]);
    if (rect1Active2[0])
    // First Rectangle's coloring of the Region Two
    if(DC2[0] == DF2[0])
    g.setColor(Color.black);
    g.fillRect(rect1xco2[0]+4,rect1yco2[0]+2,rect1width2[0]-4,rect1height2[0]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco2[0]+2,rect1yco2[0],rect1width2[0]-1,rect1height2[0]-1);
    g.drawRect(rect1xco2[0]+3,rect1yco2[0]+1,rect1width2[0]-3,rect1height2[0]-3);
    else if(DC2[0] > DF2[0])
    g.setColor(Color.red);
    g.fillRect(rect1xco2[0]+4,rect1yco2[0]+2,rect1width2[0]-4,rect1height2[0]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco2[0]+2,rect1yco2[0],rect1width2[0]-1,rect1height2[0]-1);
    g.drawRect(rect1xco2[0]+3,rect1yco2[0]+1,rect1width2[0]-3,rect1height2[0]-3);
    else if(DC2[0] < DF2[0])
    g.setColor(Color.green);
    g.fillRect(rect1xco2[0]+4,rect1yco2[0]+2,rect1width2[0]-4,rect1height2[0]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco2[0]+2,rect1yco2[0],rect1width2[0]-1,rect1height2[0]-1);
    g.drawRect(rect1xco2[0]+3,rect1yco2[0]+1,rect1width2[0]-3,rect1height2[0]-3);
    else
    if(DC2[0] == DF2[0])
    g.setColor(Color.black);
    g.fillRect(rect1xco2[0]+2,rect1yco2[0],rect1width2[0],rect1height2[0]);
    else if(DC2[0] > DF2[0])
    g.setColor(Color.red);
    g.fillRect(rect1xco2[0]+2,rect1yco2[0],rect1width2[0],rect1height2[0]);
    else if(DC2[0] < DF2[0])
    g.setColor(Color.green);
    g.fillRect(rect1xco2[0]+2,rect1yco2[0],rect1width2[0],rect1height2[0]);
    if (rect1Active2[1])
    // Second Rectangle's coloring of the Region Two
    if(DC2[1] == DF2[1])
    g.setColor(Color.black);
    g.fillRect(rect1xco2[1]+4,rect1yco2[1]+2,rect1width2[1]-4,rect1height2[1]-4);
    g.setColor(Color.yellow);
    g.drawRect(rect1xco2[1]+2,rect1yco2[1],rect1width2[1]-1,rect1height2[1]-1);
    g.drawRect(rect1xco2[1]+3,rect1yco2[1]+1,rect1width2[1]-3,rect1height2[1]-3);

    Could you show me how to use it as an applet. If you
    can modify my code and make it working it would be
    very helpful.
    Best regards
    AliPerhaps you could start [url http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html]here[url                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to use a packaged Jar File?

    Greetings to everyone reading this post!
    I have a query about a thing that seems to be basic but I don't know how to accomplish, here it goes:
    I have packaged a Simple application into a Jar file. this application contains a package like this:
    lib.demo, inside this package I have a Class named MyClass with some simple methods like this one:
    public void sayHi(String name){
    //implementation here
    }Now, I would like to Know how to use the Method sayHI(String name) from an entirely different Project. I have successfully included the Jar File as a Library(in the new Project), but I have I no Clue on How to invoke a Class inside my Jar library, and more Importantly, a method.
    Could anybody help me?

    if the "project" (not a Java-related system, it's IDE-specific) already includes the JAR file in its classpath (library), then all you need is to import the package/class and invoke the method, as such:
    // in your client code:
    import lib.demo.*;         // or, import lib.demo.MyClass;
    public class Test {
      public void inAMethod() {
        MyClass myC = new MyClass();
        myC.sayHi("say hi"); 
    }simple.

  • One of my friend gave me an iPhone 4S country of orgin not uk please advice how can use uk sim?

    Hi there my friend gave me an iPhone 4S. I insert SIM card,but is not  working I have checked that phone come from Europe &amp; sim blocked please advice how do I use uk sim?

    You can't.
    If the phone is locked to another network you can only use it on that network.
    You would need to contact the network the phone is locked to and find out if they offer unlocking and what you need to do to qualify. If you're not a customer of this network, its unlikely they will unlock it for you.

  • How to use DDE package in form 10g module

    Hi All,
    I am using DDE.package in form 10g for uploading excels data in oracle database at windows platform but it is showing non-oracle exception.
    Thanks

    hi
    mehwish............just do for attachment.......
    u can also use something like this...
    Execute send_mail;and also.
    try something like this..
    example:
    begin
    mahi.mail('email address','subject','message','attachment');
    end;Edited by: Sarah on Apr 18, 2011 10:25 AM

  • How to use the packager with Flash?

    Hi all,
    I've installed the packager, but I can't see any difference inside Flash CS5 editor or any new menus like "Export" or "Package"
    Does it work from within the editor or does it only compile AS3 files?
    Can I turn a Flash project which has an .fla file with some timeline animation, manually created MovieClips etc into a iOS app using the packager?
    Is there any tutorial how to do it?
    Thanks!

    I'm compiling a public list of useful links for exactly these sorts of situations: http://forums.adobe.com/thread/785692
    Have you installed the latest updates to Flash CS5? They are the first 2 links under "Downloads and Official Documentation" in the link above. Then you should be able to start a new project in Flash and specify "iPhone OS". From there, try to follow Adobe's official documentation until it doesn't work properly, then come back, search around for others talking about the same issues, or start a new thread that is more specific.
    Hope that helps a bit.

  • My new ipad 2 is missing Garage Band but I've  had a welcome email from Apple with a video showing how to use it. How do I get it?

    My new ipad2 is missing Garage Band but I've had a welcome email from Apple with a video of how to use it. How've do I get it?

    Thank you. I tried searching for it in the App store earlier but only the 'learn garage band in 30 days' came up - just tried again andvth garage band app came up. Great App for £2.99 !! Thanks for you help :-)

  • How to use a package as an interface for doing DML on a tabular region?

    Hello,
    I want to build a page to perform DML. However, I want to use a package containing the procedures for the select, insert, update and delete statements. The reason is that there is a one-to-many relationship between the table shown on the screen and the tables in the database.
    When the page is first displayed, I want to call the SELECT procedure.
    When the user is done with their changes, I want to loop through the rows and perform
    the DELETE procedure on all the deleted rows and
    the UPDATE procedure on each modified row.
    What is the easiest way to do this?
    Where do I start reading/learning?
    Thanks,
    Gabor

    Hi Gabor,
    If you base your Tabular Form on a database view, you can use an INSTEAD OF trigger to invoke your package. Have a look at this article, which describes this technique with some example code:
    http://rokitta.blogspot.com/2009/12/tabular-forms-on-complex-views-using.html
    regards,
    Christian

  • Tutorial Showing How to Use SQLite with Classes

    I am writing a mobile app with Flex 4.5.1 and I will need to write and read to a SQLite database.  The previous times I have done this in previous versions of Flex, I just put all of my database code on the same main page which wasn't the most efficient way to do it, but it worked.
    I've been looking all over to find a tutorial that shows how to set the database up so that it is "called" when needed and I'm assuming it would be put in a Class for this to happen.  Can anyone direct me to some examples showing how to do this?
    Thank you in advance.
    Dave

    If I type it as you showed in the example, I get a "1170: Function does not return a value." error when I try to save the AS document.  Here's what my code looks like:
    public function getThings():ArrayCollection
                stmt = new SQLStatement();
                stmt.sqlConnection = sqlConnection;
                stmt.text = "SELECT * FROM contract";
                stmt.execute();
    Thanks.

  • Please tell how to use package and import?

    Hi,
    My classes are in different packages
    for eg
    package manage.ui
    package manage.data
    package manage.layer
    if I try to import
    import manage.layer.*;
    in a class in manage.ui
    it shows
    package manage.layer does not exist
    Please help to find the problem?????

    Are your classes placed in a folder stucture that mirrors the package structure? So, like this:
    -manage(folder)
    --ui(subfolder of manage)
    --data(subfolder of manage)
    --layer(subfolder of manage)

  • Please  explain how to use JarURLClassLoader?

    If you can please give an example.
    I want to know how to load classes from jar files and invoke them.

    You don't NEED to... that class is used internally by the JVM so don't care about it in your applikation. To test what I'm now saying do like this:
    Copy this class, compile it and put it into a jar-file. My jarfile was in the dir D:\javaforum\testmain\test.jar
    package lime.test.frames;
    import java.awt.BorderLayout;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    public class TestFrame extends JFrame {
         private static final long serialVersionUID = 1L;
         private JPanel jContentPane = null;
         private JLabel jLabel = null;
          * This is the default constructor
         public TestFrame() {
              super();
              initialize();
          * This method initializes this
          * @return void
         private void initialize() {
              this.setSize(300, 200);
              this.setContentPane(getJContentPane());
              this.setTitle("JFrame");
          * This method initializes jContentPane
          * @return javax.swing.JPanel
         private JPanel getJContentPane() {
              if (jContentPane == null) {
                   jLabel = new JLabel();
                   jLabel.setText("Called!");
                   jContentPane = new JPanel();
                   jContentPane.setLayout(new BorderLayout());
                   jContentPane.add(jLabel, BorderLayout.CENTER);
              return jContentPane;
         public static void main(String[] args) {
              TestFrame t = new TestFrame();
              t.setVisible(true);
    }Copy this class and put it wherever you want to, as long as it is not in the same catalog as the previous class or the jar-file created.
    package lime.javaforum;
    import lime.test.frames.*;
    public class InvokeTest {
          * @param args
         public static void main(String[] args) {
              TestFrame.main(args);
    }Compile it and start the InvokeTest with:
    [java -cp <path to jar> lime.javaforum.InvokeTest[/i]
    and see what will happen...

Maybe you are looking for

  • Ipod Touch generation 2 ios 4.2.1

    is there any good games/apps for the 2nd generation ipod touch ios 4.2.1?

  • How can we do the validation for non visible records in table control.

    Hi Experts,   I have a table control which displays list of material details. I have a button to upload the material details from excel file to table control directly. I have to validate all the customers which are exist in the table. But my item (Ma

  • Cash Discount has become unrestricted

    Dear Experts, I have configured cash discount through payments term route. I have also maintained the SKTO condition in SD in pricing procedure. The issue is that while clearing (F-32) the system is accepting whatever discount we are entering. It is

  • Reg: Reverse PO distribution issue

    Hi Consultants, User has tagged invoice to PO(line 2 and 3) then invoice was cancelled with some resons but po distribution did not reverse the amount and quantity still it is showing the quatity and billed amount then user again applied a invoice to

  • How to download company hierarchy in BCS

    Hi, We have around 120 company codes listed in about 15 hierarchies.  Is there any way to download complete hierarchy structure (which is appearing in UCMON) to a text file ? Best Regards, Madhu