Creating a package. How to include standatd PL/SQL procedure?

Dear All,
I need to create a job in oracle schema where in it should to do the following actions.
1. Refresh the Mat View Refresh group.
2. Execute a procedure immediately after the above refresh happens.
Hence I tried to create a package to include both the actions. But unable to create.
Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.3.0
Connected as GDB_DEEP
SQL>
SQL> CREATE OR REPLACE PACKAGE GDB_GHD_REP AS
  2    PROCEDURE DBMS_Refresh.refresh(refgrp);
  3    PROCEDURE Update_user_details_test();
  4  END;
  5  /
Warning: Package created with compilation errors
SQL>
SQL> CREATE OR REPLACE PACKAGE BODY GLOBALDB_GHD_REP AS
  2    PROCEDURE DBMS_Refresh.refresh('MVRFRSHGRP_GDBGHD');
  3    PROCEDURE Update_user_details_test();
  4  END;
  5  /
Warning: Package body created with compilation errors
SQL> I understand that predefined oracle procedures should not be used like this, but Im trying to get a solution.
Please help me in finding a solution.
Is it possible to run two procedures one after the other with a single job?
Regards
Deep

Hi, Deep,
Deep. wrote:
Dear All,
I need to create a job in oracle schema where in it should to do the following actions.
1. Refresh the Mat View Refresh group.
2. Execute a procedure immediately after the above refresh happens.
Hence I tried to create a package to include both the actions. But unable to create.
Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.3.0
Connected as GDB_DEEP
SQL>
SQL> CREATE OR REPLACE PACKAGE GDB_GHD_REP AS
2    PROCEDURE DBMS_Refresh.refresh(refgrp);
3    PROCEDURE Update_user_details_test();
4  END;
5  /
Warning: Package created with compilation errors
SQL>
SQL> CREATE OR REPLACE PACKAGE BODY GLOBALDB_GHD_REP AS
2    PROCEDURE DBMS_Refresh.refresh('MVRFRSHGRP_GDBGHD');
3    PROCEDURE Update_user_details_test();
4  END;
5  /
Warning: Package body created with compilation errors
SQL> I understand that predefined oracle procedures should not be used like this, but Im trying to get a solution.
Please help me in finding a solution.
Is it possible to run two procedures one after the other with a single job?
Regards
DeepSure; call them from your own procedure. For example:
CREATE OR REPLACE PACKAGE globaldb_ghd_rep AS
      PROCEDURE  refresh_and_test (refgrp  IN  VARCHAR2);
      PROCEDURE  update_user_details_test;
    END;
SHOW ERRORS
CREATE OR REPLACE PACKAGE BODY globaldb_ghd_rep AS
      PROCEDURE  refresh_and_test (refgrp  IN  VARCHAR2)
      IS
      BEGIN
          DBMS_Refresh.refresh(refgrp);
             update_user_details_test;
      END  refresh_and_test;
      PROCEDURE  update_user_details_test
      IS
      END  update_user_details_test;
END  globaldb_ghd_rep
SHOW ERRORSWhen used immediately after the CREATE commands, the SQL*Plus command SHOW ERRORS displays more complete error messages.

Similar Messages

  • How to call a PL/SQL procedure from Portal

    Env.Info: Windows NT Server 4 (Service Pack 3) / Oracle 8i R3 EE / Oracle Portal 3.0 Production.
    I created a new schema "BISAPPS" and created a user with the same name. Ran provsyns.sql script to grant Portal API access. Created a new package under this new schema and compiled it against the database. After that I registered the schema as a portal provider. There were no errors.
    Now I logged into Portal using the account PORTAL30. Refreshed the portlet repository and the new portlets appeared. I added the new portlet to the page. It is displayed successfully.
    New portlet allows the user to enter a bug-number and lets the user to either view or edit. If the user clicks on the button "Edit", it opens a new window and displays the contents from BugDB application. But if the user clicks on "Show", it should display the output generated by a PL/SQL procedure (Owned by the above New Schema - BISAPPS) in a separate window. But instead it is displaying the following error in the separate window:
    bisapps_pkg.buginfo: PROCEDURE DOESN'T EXIST.
    DAD name: PORTAL30
    PROCEDURE : bisapps_pkg.buginfo
    URL : http://host_name:80/pls/portal30/bisapps_pkg.buginfo
    And list of environment variables ....
    Can anyone help me? How can I call a PL/SQL procedure when the button is clicked? Thanks in advance.

    You must grant EXECUTE privilege on your procedure to the PORTAL30_PUBLIC user. If the error still persists, create a PUBLIC synonym for your procedure.

  • How to poll a PL/SQL procedure in BPEL?

    Hi,
    Normally in BPEL your start your process flows by receiving an event. You can only create a BPEL instance via a Receive or Pick activity. I have a couple of integrations where I have to continually call a PL/SQL procedure and then call another PL/SQL procedure with the output from the first procedure. This is done by invoking 2 partner links and a While activity. I got this working fine. The problem is how to create the instance. At the moment I start the flow by reading in a dummy file with a Receive event. This works for now but if the process has to be restarted it will not work since BPEL know that it has already read the file.
    I have tried to start the flow with a receive activity that calls a PL/SQL procedure but I get the error “Operation is not specified” (http://theheat.dk/bpelDb1.jpg). Normally you would use a Invoke activity when calling a PL/SQL procedure, but when I try that I get an error because I don’t have a receive activity first (http://theheat.dk/bpelDb2.jpg)
    So basically I need a way to have a receive activity call a PL/SQL procedure.
    I have the exact same problem when I need to continually call a Web Service and send the output to a PL/SQL procedure. Here I need an Invoke activity that calls the Web Service and an Invoke that calls the PL/SQL procedure but to get the flow initiated BPEL wants a receive activity.
    Regards Pete

    I found a simple solution that works but I would like to hear if anybody can see any problems with this approach:
    I create a dummy table with one row. I create a partner link that polls the dummy table every 5 minutes. The operation on the table is an update, but the Read value and Unread value are the same!
    Every 5 minutes BPEL kicks of a process that calls a PL/SQL procedure etc. There will always be a row in the dummy table and as long as my polling interval is longer than the processing time of the flow I will never have more than one process in-flight at a time. This should ensure that the solution is robust.
    Regards Pete
    Message was edited by:
    Peter Lorenzen
    Message was edited by:
    Peter Lorenzen

  • How to call a PL/SQL procedure from a Java class?

    Hi,
    I am new to the E-BusinessSuite and I want to develop a Portal with Java Portlets which display and write data from some E-Business databases (e.g. Customer Relationship Management or Human Resource). These data have been defined in the TCA (Trading Community Architecture) data model. I can access this data with PL/SQL API's. The next problem is how to get the data in the Java class. So, how do you call a PL/SQL procedure from a Java program?
    Can anyone let me know how to solve that problem?
    Thanks in advance,
    Chang Si Chou

    Have a look at this example:
    final ApplicationModule am = panelBinding.getApplicationModule();
    try
         final CallableStatement stmt = ((DBTransaction)am.getTransaction()).
                                                                                         createCallableStatement("{? = call some_pck.some_function(?, ?)}", 10);
         stmt.registerOutParameter(1, OracleTypes.VARCHAR);
         stmt.setInt(2, ((oracle.jbo.domain.Number)key.getAttribute(0)).intValue());
         stmt.setString(3, "Test");
         stmt.execute();
         stmt.close();
         return stmt.getString(1);
    catch (Exception ex)
         panelBinding.reportException(ex);
         return null;
    }Hope This Helps

  • How to call a PL/SQL procedure from a xml Data Template

    We have a requirement in which we need to call a pl/sql package.(dot)procedure from a Data Template of XML Publisher.
    we have registered a Data Template & a RTF Template in the XML Publisher Responsibility in the Oracle 11.5.10 instance(Front End).
    In the Data Query part of the Data Template , we have to get the data from a Custom View.
    This view needs to be populated by a PL/SQL procedure.And this procedure needs to be called from this Data Template only.
    Can anybody suggest the solution.
    Thanks,
    Sachin

    Call the procecure in the After Parameter Form trigger, which can be scripted in the Data Template.
    BTW, there is a specialized XML Publisher forum:
    BI Publisher

  • How to secure a PL/SQL procedure that is called from the web browser

    If you have ever seen the sample document management application, and tried to download a file that was stored in the system, you are probably familiar with the apex_util.count_click URL that is used to download the file. If you copy that URL and paste it into a new browser, you will not be prompted to login to download the requested file. I'm using SSO with Apex as a partner application. How can I secure a pl/sql procedure like this to redirect to the login page before beginning the download?
    Thanks,
    Kris

    You can use the second method described here:
    http://apex.oracle.com/pls/otn/f?p=31517:15
    You would use an application process instead of pasting the procedure call in the browser. In the case I describe, you don't need to grant execute to public on the download procedure.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • How do I debug pl/sql procedures from a bc4j application

    Hi,
    I would like to use jdevelopers pl/sql debugging capabilities to debug some code that is executed by triggers in the database, when inserting records through my bc4j client application.
    I already found the remote debugging feature of jdeveloper, but that requires setting up a separate debugger listener, and it also requires me to put the following statement in the session:
    DBMS_DEBUG_JDWP.CONNECT_TCP ('hostname_or_ip', port_number)
    Where and how can I put this line of pl/sql code to make it execute each time I launch the bc4j application?
    Or is it possible to use one debugger process (the one that's also using the java breakpoints) to debug both pl/sql and java code?
    Greetings,
    Ivo

    I have the same problem.
    I have a PL/SQL function that returns a number. This function receives 2 parameters. I use StoredProcedureCall plus ValueReadQuery.
    Session aSession = SessionManager.getManager().getDefaultSession();
    StoredProcedureCall call = new StoredProcedureCall();
    call.setProcedureName("CIO_UTILS.COUNT_USER_ROLES_IN_MODULE");
    call.addNamedArgument("p_persid");
    call.addNamedArgument("p_module");
    call.addUnamedOutputArgument("rolesnum", Integer.class);
    ValueReadQuery query = new ValueReadQuery();
    //query.bindAllParameters();
    query.setCall(call);
    query.addArgument("p_persid");
    query.addArgument("p_module");
    Vector parameters = new Vector();
    parameters.addElement(persid);
    parameters.addElement(theModule);
    Integer rolesnum = (Integer) aSession.executeQuery(query,parameters);
    aSession.release();
    if(rolesnum.intValue()<=0)return false; else return true;
    However, I receive the following error:
    Exception [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-06550: line 1, column 96:
    PLS-00312: a positional parameter association may not follow a named association
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Error Code: 6550
    Call:BEGIN CIO_UTILS.COUNT_USER_ROLES_IN_MODULE(p_persid=>'SANCRA2791', p_module=>'PSL_MONITORING', ?); END;
         bind => [=> rolesnum]
    If comment the line
    "call.addUnamedOutputArgument("rolesnum", Integer.class);"
    Toplink is trating it as a procedure, and I also receive an error from PL/SQL.
    There should have to be a way of make it to receive the resoult somehow, but I do not know what.
    Thanks in advance.

  • How to call a PL/SQL Procedure from a Report Column Hyperlink

    Hallo!
    Normally a link on a column value in a report leads you to a page in your application or to another URL.
    And you can send the value of this cell to the calling page.
    I want, that oracle executes a procedure with the values as in-Parameters if I click on this hyperlink.
    Must I call a dummy page and define this procedure in the header of this page or exit there other ways?
    Can you give ma an example?
    Thanks a lot!
    Gerhard

    Paul - When a column link is used to invoke a On Demand Process in that way, wouldn't that result in a blank page (unless of course the ODP emits a well-formed HTML document)? You could set the link target to a no-op like *#* and use a onclick handler in the Link Attributes to call a Javascript that uses the htmldb_get object to call the ODP. In fact, I don't think I have ever seen a ODP used in any other context.

  • How to create a package and add a file?

    Hi all,
    I am new to Java and very much much confussed with how to create a package and then include some files any help will be very thankfull.
    Thanks for your help
    kka.

    Steps for creating a package in java are as follows:
    Choose a base directory for your classes. For example, you might choose c:\java\packages. Type the following command:
    set CLASSPATH=%CLASSPATH%;c:\java\packages
    Create subdirectories for each chapter or section, if you don't already have them.
    For each of the classes in the subdirectories, add the following line to the very top of each file:
    package directory-name;
    where directory-name is the name of the subdirectory the class file is located in.
    In other directories you may have class files that need to access one of the classes in another directory (package). To do this, write one of the following at the top of the class that needs the other class:
    import subdir.*;
    or
    import subdir.classname;
    Use the class by name in the new class file.
    Note that you can create sub-packages by creating subdirectories of the original subdirectories, and inserting package statements at the top of the java files in those directories.
    Hope this helps!

  • Creating Excel Workbook from PL/SQL Procedure

    I am trying to create Excel Workbook with two worksheets from PL/SQL procedure. I created one worksheet. Can I create a separate sheet from same procedure. I used OWA_UTIL.MIME_HEADER ('application/vnd.ms-excel', FALSE)
    command to create the spreadsheet.
    Any help would be helpful.
    Thanks
    Yagna Shah

    Further to my previous post here is how I will develop a typical master details excel report.
    by using the package,
    It will also show sum of salary at each department.
    Note : When I paste the code here I loose the indentation. So the code below is not indented properly.
    DECLARE
    r NUMBER := 0 ; --- r IS the ROW NUMBER IN this excel file
    l_sum NUMBER ;
    BEGIN
    --- Generate the styles that we need
    gen_xl_xml.create_excel( 'UTL_DIR','master_Detail.xls') ;
    gen_xl_xml.create_style( 'dept_title' , 'Arial', 'Red',14, p_backcolor => 'LightGray' );
    gen_xl_xml.create_style( 'sgs2' , 'Arial', NULL ,10, p_bold => TRUE );
    gen_xl_xml.create_style( 'sgs3' , 'Arial', 'blue',14 );
    gen_xl_xml.create_style( 'sgs4' , 'Arial', 'green',14 );
    gen_xl_xml.create_style( 'emp_title' , 'Arial', 'Black',9, p_backcolor => 'LightBlue' );
    gen_xl_xml.create_style( 'sal_tot' , 'Arial', 'Brown',13, p_backcolor => 'Yellow' );
    -- SET ANY COLUMN AND ROW changes
    gen_xl_xml.set_column_width( 3, 145 );
    gen_xl_xml.set_column_width( 4, 145 );
    l_sum := 0 ;
    FOR recd IN ( SELECT department_id, department_name FROM departments ) LOOP
    IF l_sum <> 0 THEN
    r := r +1 ;
    gen_xl_xml.write_cell_char( r, 4, 'Department Total ->' , 'sal_tot' );
    gen_xl_xml.write_cell_num( r, 5, l_sum , 'sal_tot' );
    l_sum := 0;
    END if ;
    r := r+1 ;
    gen_xl_xml.write_cell_CHAR( r,1, 'Department : '|| recd.department_name , 'dept_title' );
    -- As we need same style applied till the above data flows use write_cell_null
    gen_xl_xml.write_cell_NULL( r,2 , null );
    gen_xl_xml.write_cell_NULL( r,3, 'dept_title' );
    gen_xl_xml.write_cell_NULL( r,4, 'dept_title' );
    gen_xl_xml.write_cell_NULL( r,5, 'dept_title' );
    --- Add employee heading
    r := r+1 ;
    gen_xl_xml.write_cell_CHAR( r,2, 'EmployeeID' , 'emp_title' );
    gen_xl_xml.write_cell_CHAR( r,3, 'First Name' , 'emp_title' );
    gen_xl_xml.write_cell_CHAR( r,4, 'Last Name' , 'emp_title' );
    gen_xl_xml.write_cell_CHAR( r,5, 'Salary' , 'emp_title' );
    FOR rec IN (SELECT employee_id , first_name , last_name, salary FROM employees WHERE department_id = recd.department_id ) LOOP
    r := r+1 ;
    gen_xl_xml.write_cell_num( r,2, rec.employee_id, 'sgs2' );
    gen_xl_xml.write_cell_char( r,3, rec.first_name, 'sgs3' );
    gen_xl_xml.write_cell_char( r,4, rec.last_name , 'sgs4' );
    gen_xl_xml.write_cell_num( r,5, rec.salary );
    l_sum := l_sum + rec.salary ;
    END LOOP ;
    END LOOP ;
    gen_xl_xml.close_file ;
    END ;
    -----------------------------------------------------------------------------------------------------------------

  • How to make pl/sql procedure not auto-commit?

    I wish to be able to execute a create statement, and then rollback if there is a problem with any sql that follows. It seems that you cannot rollback? Why is this?
    (My problem is that I wish to execute a series of sql statements and run a rollback if anything before it fails, including the creation of the table)
    set serveroutput on;
    declare
      rcount INTEGER;
    PRAGMA AUTONOMOUS_TRANSACTION;
    begin
      execute immediate 'create table bsdconv_s1stc_code (id number)';
      dbms_output.put_line('Table created successfully');
      rollback;
    exception
      when others then dbms_output.put_line('Error while creating table. Probably already exists.');
    end;

    Ni hao, Dong Yage!
    I think using procedure and handling on call you might be able to do it.
    SQL> create table test (i int);
    Table created.
    SQL> insert into test values (1);
    1 row created.
    SQL> select * from test;
             I
             1
    SQL> set serveroutput on;
    SQL> declare
      2    rcount INTEGER;
      3  PRAGMA AUTONOMOUS_TRANSACTION;
      4  begin
      5    execute immediate 'create table bsdconv_s1stc_code (id number)';
      6    dbms_output.put_line('Table created successfully');
      7  --  rollback;
      8  exception
      9    when others then
    10       dbms_output.put_line('Error while creating table. Probably already exists.');
    11    rollback;
    12  end;
    13  /
    Table created successfully
    PL/SQL procedure successfully completed.
    SQL> desc bsdconv_s1stc_code
    Name                                      Null?    Type
    ID                                                 NUMBER
    SQL> select * from test;
             I
             1
    SQL> insert into test values (2);
    1 row created.
    SQL> set serveroutput on;
    SQL> declare
      2    rcount INTEGER;
      3  PRAGMA AUTONOMOUS_TRANSACTION;
      4  begin
      5    execute immediate 'create table bsdconv_s1stc_code (id number)';
      6    dbms_output.put_line('Table created successfully');
      7  --  rollback;
      8  exception
      9    when others then
    10       dbms_output.put_line('Error while creating table. Probably already exists.');
    11       rollback;
    12       execute immediate 'drop table bsdconv_s1stc_code';
    13  end;
    14  /
    Error while creating table. Probably already exists.
    PL/SQL procedure successfully completed.
    SQL> select * from test;
             I
             1
             2
    SQL> rollback;
    Rollback complete.
    SQL> select * from test;
    no rows selected
    SQL> desc bsdconv_s1stc_code;
    ERROR:
    ORA-04043: object bsdconv_s1stc_code does not exist
    On executing PL/SQL block secondly,
    it raises exception, displays error messages and drops table
    but main transaction is not rolled back.
    This is because rollback belongs to only inseide of
    AUTONOMOUS_TRANSACTION PL/SQL block.
    Now, let us try using procedure.
    SQL> grant create table to ushi;
    SQL> create or replace
      2  procedure create_table
      3  is
      4   PRAGMA AUTONOMOUS_TRANSACTION;
      5   begin
      6     execute immediate 'create table bsdconv_s1stc_code (id number)';
      7     dbms_output.put_line('Table created successfully');
      8  exception
      9    when others then
    10       dbms_output.put_line('Error while creating table. Probably already exists.');
    11       execute immediate 'drop table bsdconv_s1stc_code';
    12       raise;
    13  end;
    14  /
    Procedure created.
    SQL> select * from test;
    no rows selected
    SQL> begin
      2    insert into test values (1);
      3    create_table;
      4  exception
      5    when others then
      6      dbms_output.put_line('Error on Creating table or Transaction');
      7      rollback;
      8  end;
      9  /
    Table created successfully
    PL/SQL procedure successfully completed.
    SQL> select * from test;
             I
             1
    SQL> commit;
    Commit complete.
    SQL> desc bsdconv_s1stc_code
    Name                                      Null?    Type
    ID                                                 NUMBER
    SQL> begin
      2    insert into test values (2);
      3    create_table;
      4  exception
      5    when others then
      6      dbms_output.put_line('Error on Creating table or Transaction');
      7      rollback;
      8  end;
      9  /
    Error while creating table. Probably already exists.
    Error on Creating table or Transaction
    PL/SQL procedure successfully completed.
    SQL> select * from test;
             I
             1
    SQL> desc bsdconv_s1stc_code
    ERROR:
    ORA-04043: object bsdconv_s1stc_code does not exist

  • Create table statement in a pl/sql procedure

    Hi all.
    I have a problem in Oracle 10g.
    First of all I must say that I'm new in oracle 10.
    I have a stored procedure in which I have the instruction "create table name_table as
    select col1,col2,col3,..ecc
    from table1, table2
    where table1.col1 = table2.col2"
    When I compile this procedure it gives me an error.
    Is it changed the sintax????
    Is there anyone that can help me???
    Thanks all for the collaboration,
    Fabrizio

    A little mistake -- see it --
    SQL> ed
    Wrote file afiedt.buf
      1  Create or replace procedure My_procedure as
      2  begin
      3  EXECUTE IMMEDIATE 'create table my_table(fld number(5));'
      4* end;
    SQL> /
    Warning: Procedure created with compilation errors.
    SQL>
    SQL>
    SQL> ed
    Wrote file afiedt.buf
      1  Create or replace procedure My_procedure as
      2    str varchar2(200);
      3  begin
      4   str := 'create table my_table(fld number(5))';
      5  EXECUTE IMMEDIATE(str);
      6* end;
    SQL> /
    Procedure created.
    SQL>
    SQL>
    SQL> Create or replace procedure My_procedure as
      2  begin
      3  EXECUTE IMMEDIATE 'create table my_table(fld number(5));'
      4  end;
      5  /
    Warning: Procedure created with compilation errors.
    SQL> ed
    Wrote file afiedt.buf
      1  Create or replace procedure My_procedure as
      2  begin
      3  EXECUTE IMMEDIATE 'create table my_table(fld number(5))';
      4* end;
    SQL> /
    Procedure created.Regards.
    Satyaki De.
    N.B.: Please check the bolded line. You didn't write the ; outside the quotation. Otherwise, it will compile successfully.

  • How to include md5 package in application

    Hi All,
    First of all sorry I posted in another users thread. In the thread http://forums.sun.com/thread.jspa?threadID=5426671 the person used org.bouncycastle.crypto.digests.MD5Digest for doing md5.
    I need some help here on how you include the org.bouncycastle.crypto.digests.MD5Digest library in my java code as I want to use the md5.
    I am also working on something similar like that but without the web application part and a detail which consists on OTP part using md5.
    As the md5() doesn't work in j2me so was also searching for something which will work on MIDP.
    package com.abc; //package define
    public class messDig5 //class define
        private String generateHash(String OTP, int loopNum) {
            byte[] secretBytes = OTP.getBytes();
            for (int x = 0; x < loopNum; x++) {
                byte[] tempStore = new byte[16];
                tempStore = hash(secretBytes);
                secretBytes = tempStore;
         //   return convertToHex(secretBytes);
            return byteArrayToHexString(secretBytes);
        public byte[] hash(byte[] secretBytes) {
           org.bouncycastle.crypto.digests.MD5Digest digest = new org.bouncycastle.crypto.digests.MD5Digest();
            digest.reset();
            // Update MD5 digest with user secret in byte format
            digest.update(secretBytes, 0, secretBytes.length);
            // get length of digest to initialise new md5 byte array
            int length = digest.getDigestSize();
            // create md5 byte array using length
            byte[] md5 = new byte[length];
            // calculate MD5 hash, using md5 byte array, 0 for buffer offset
            digest.doFinal(md5, 0);
            return md5;
    //    private static String convertToHex(byte[] data) {
    //        StringBuffer buf = new StringBuffer();
    //        String Hex;
    //        String formattedHex;
    //        for (int i = 0; i < data.length; i++) {
    //            int halfbyte = (data[i] >>> 4) & 0x0F;
    //            int two_halfs = 0;
    //            do {
    //                if ((0 <= halfbyte) && (halfbyte <= 9)) {
    //                    buf.append((char) ('0' + halfbyte));
    //                } else {
    //                    buf.append((char) ('a' + (halfbyte - 10)));
    //                halfbyte = data[i] & 0x0F;
    //            } while (two_halfs++ < 1);
    //        Hex = buf.toString();
    //        formattedHex = "\n" + Hex.substring(0, 4) + " " + Hex.substring(4, 8) + " " + Hex.substring(8, 12) + " " + Hex.substring(12, 16) + " " + Hex.substring(16, 20) + " " + Hex.substring(20, 24) + " " + Hex.substring(24, 28) + " " + Hex.substring(28, 32);
    //        return formattedHex;
        static String byteArrayToHexString(byte byteValues[]) {
            byte singleChar = 0;
            if (byteValues == null || byteValues.length <= 0) {
                return null;
            String entries[] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
                "a", "b", "c", "d", "e", "f"};
            StringBuffer out = new StringBuffer(byteValues.length * 2);
            for (int i = 0; i < byteValues.length; i++) {
                singleChar = (byte) (byteValues[i] & 0xF0);
                singleChar = (byte) (singleChar >>> 4);
                // shift the bits down
                singleChar = (byte) (singleChar & 0x0F);
                out.append(entries[(int) singleChar]);
                singleChar = (byte) (byteValues[i] & 0x0F);
                out.append(entries[(int) singleChar]);
            String rslt = new String(out);
            return rslt;

    Camellia,
    I take you already added bouncycatsle to your project as a compile dependency, since it compiles (unless it does not).
    All you have to do for your code to work on the phone, you need to build your JAR file (that you use to distribute your MIDlet) with bouncycastle packaged in. This will all depend on the method you use to build your JAD and JAR files.
    I use antenna tool, which provides me with ant tasks to compile, build jar, package external libraries etc. Your scenario can be different, but all you have to do is to search manuals and/or google for methods on how to package external libraries with your build.
    Daniel

  • [Solved] How to include examples for an AUR package

    Hi,
    I read the wiki pages how to create packages for the AUR,
    but I am not sure how to include examples which should be placed
    in /usr/share/doc/<package>/examples/ after the package was installed.
    Should all files be mentioned in the "sources" variable of the PKGBUILD
    or is it better to copy them via the .install file?
    Last edited by fana (2012-01-22 17:38:41)

    fana wrote:Ah, I see. So a good way would be just providing a tarball with all the examples and add that tarball to the source array
    Yup, I don't see how are these are examples different [1] from the other files.
    [1] Well, apart from stuff like https://bugs.archlinux.org/task/25998 ;P

  • How to include a prebuilt package in packagemaker

    I wish to create a package that installs software, but the software depends on X11 support. So, I would like to have the package that I am making install XQuartz if it is missing. I have the XQuartz package, but I can't seem to make it go into PackageMaker in order to have it install.
    What am I missing?
    If there are any tutorials that you guys know of that would explain this or even how to use package maker, I would welcome the extra material.
    Thanks

    Sorry, but PackageMaker is black magic. I used to know many of the tricks a few years ago but PackageMaker changes pretty often and I'm not confident that those tricks will still work or that I remember them.
    I can tell you that you need to build a tree of directories that mirrors where you are going to install. So, if you need to install your app in /Applications along with XQuartz, you would create a directory somewhere to create your package from called /path/to/packagemaker/source. Then, under that directory, you would have all the directories you want to install. It would look like this:
    /path/to/packagemaker/source/Applications/YourApp.app
    /path/to/packagemaker/source/opt/bin/XQuartz.app
    /path/to/packagemaker/source/opt/share/ ... XQuartz stuff
    /path/to/packagemaker/source/opt/lib/ ... XQuartz libs
    /path/to/packagemaker/source/opt/include/ ... XQuartz includes
    This is assuming that your app is named "YourApp" and XQuartz gets installed in /opt by default.
    Then you change the ownership of /path/to/packagemaker/source to root and build your package from that.
    To make matters more difficult you might need to deal with Apple's funky X11 on-demand loader. Make sure to test that.

Maybe you are looking for

  • PO- Recommunicated - Need to find who has done that

    Hi Team, I am having one interesting question on PO email communication to supplier. I have a PO which was created , shipped, invoiced and closed in March-2012, but unfortunately some body from business users re-communicated the PO to supplier again

  • How to select same descendant members from different hierarchies?

    Hi All,  please help, how it is possible to select same values for only the same hierarchy member names from different hierarchies? Example: L1          #L1          L2          #L2          Value A          #A          a1          #a1          7 A  

  • USB internet dongle connection

    I have a mobile telephone with sim card. I have an old USB dongle. I put the sim card in the usb dongle and use it to surf the net. Question is what is best / quickest / cheapest : to use the Huawei Modem over the phone number *99# or to use the "Mob

  • Asset reports- diff. results with certain restrictions

    Hi experts, I have problem with asset reports (RABEST_ALV01, RAHAFA_ALV01) . When I choose company code, choose sort variant 07 (company code/ asset class),report date 31st of december 2008, depr. area 01, acquisition value lower than 995 EUR and cho

  • Java.lang.SecurityException: [Security:090398]Invalid Subject - multithre..

    Hi I am getting java.lang.SecurityException: [Security:090398]Invalid Subject ... under the following scenario: - I have a simple dispatcher class which is starting a number of threads, every one of them sending messages to different Weblogic server.