FM extractor, which variable holds function call #?

Hi All,
I've got a complex extraction scenario with a one to many relationship between some entites which causes some issues.
I'm writing a FM extractor and I'ld like to keep track of which data packet number that is currently being extracted. For instance, if max-size is eq 1000, I would like to capture that the records being fetched 1000-2000 is the third fetch (init being the first).
My undertanding is that I_REQUNR will not contain a numerical value and I_INITFLAG is a flag for init call to the FM only. Is there an import parameter I can use to keep track of which call that is currently being executed?
Thanks,
Petter

Hi,
Thanks a lot for reply.
Function " SLS_MISC_GET_LAST_DAY_OF_MONTH " was not remote enabled.
Its working fine now.
Thanks & Regards,
Anup

Similar Messages

  • Actionscript variable name function call

    I'm attempting to call a function dynamically using a string variable.  I know that to normally do this, I would use code like the following:
         var functionName:String = "ii_" + currentItem.id;
         var myData:Array = this[functionName](parameter1, parameter2, parameter3);
    However, my function is actually in another flex directory/package called UploadApps.customUploadFunctions.  I've tried this sort of thing:
         var functionName:String = "ii_" + currentItem.id;
         var myData:Array = UploadApps.customUploadFunctions.this[functionName](parameter1, parameter2, parameter3);
    but this doesn't work.  Any ideas on how I go about calling a function with a variable name in another package?
    John

    Thanks Alex.  The function in the package is defined as:
             package UploadApps.customUploadApps
                  public function ii_000010(inputItem:InputItem, periodDates:Object, inputItemBox:VBox, branchId:int, uploadStatusData:ArrayCollection, validatorArray:Array):Array {
    with the file name being ii_000010.as, but when I call it as such:
             import UploadApps.customUploadApps.*;
              var functionName:String = "ii_" + currentItem.id;
              someArray = UploadApps.customUploadApps[functionName](currentItem, thisFieldDates, inputItemBox, BranchId, uploadStatusData, validatorArray);
    I get the errors:
             1120: Access of undefined property UploadApps.customUploadApps.
              1182: Package cannot be used as a value: UploadApps.customUploadApps.
    John

  • SSDT vs 2013 and Clr function, call a Clr method name dynamically using SQLCMD variables

    Hello,
    My question is this, hopefully this makes sense:
    How could I got about doing this, inside a SQL function, I would like to re-name the Clr method call based on a SQLCMD variable? 
    I have a Clr project to encrypt/decrypt data, there are different method names depending on the deployment types.
    For the definition of a function called dbo.EncryptThis, I would like to use a SQLCMD variable to change the name depending on SQLCMD variables. This works fine in SQL Server Mgmt studio, but VS 2013 fails to recognize the SQLCMD variable and the build fails
    with: "Error
    1
    SQL71521: A method with a matching signature was not found in the loaded assembly.".
    THis code works fine in SQL Server Mgmt Studio, but fails to build in the SSDT project.
    In the SSDT project I have the SQLCMD variable defined and think I have SQLCMD mode enabled, by doing this:
    Right click file > Execution Settings > SQLCMD mode
    CREATE FUNCTION [dbo].[EncryptData]
    (@str NVARCHAR (MAX))
    RETURNS NVARCHAR (MAX)
    AS
    EXTERNAL NAME [CryptoClrAssembly].[LibName].[EncryptData$(MethodName)]
    Is this even possible in SSDT? or would I have to do this in a post-deploy script?

    Hi Kevin,
    Thanks for the info.
    Bummer, so the only other solution I have is to create a post-deploy script to change the function based on a SQLCMD variable or other logic?
    What would be really cool, would be if during the build process the SQLCMD variables would get replaced with the default value to the SQLCMD variable, thus would allow to build the project. Also, during deployment, if someone entered an incorrect method
    from the assembly it would just fail.

  • Package interpeting function call as variable call

    When I try to compile my package the compiler mistakes the function calls in this collection for variables.:
    type dayonelist IS TABLE OF NUMBER;
    dayone dayonelist := dayonelist(wkdaysminusone(), sadaysminusone(), sudaysminusone());
    I get this error message:
    Error(244,35): PLS-00306: wrong number or types of arguments in call to 'WKDAYSMINUSONE'
    Anyone know how I can correct this?

    rthakur-
    I'm a beginner at this and looking for help and not smart comments. I may not have your experience but I have a little more courtesy than you. Here's the package code:
    CREATE OR REPLACE
    package accessreports is
    vc_FirstofMonth DATE;
    vc_CurrentPick date;
    PROCEDURE PICK_DATE
    (p_first_of_month IN DATE);
    PROCEDURE EXEC_REPORTS(p_first_of_month IN DATE);
    PROCEDURE PRODUCTIVITY_INSERT
    (p_first_of_month IN DATE);
    PROCEDURE AVERAGE_BOARDINGS
    (p_first_of_month IN DATE);
    end accessreports;
    CREATE OR REPLACE PACKAGE BODY accessreports IS
    /*Below are all functions that provide variables for calulations and WHERE
    clauses. All functions are at the top of the package for visibility to all procs and
    convenience*/
    FUNCTION curpick RETURN DATE IS p_current_pick DATE;
    BEGIN
    SELECT MAX(pick) AS
    pick
    INTO p_current_pick
    FROM bus_picks;
    RETURN p_current_pick;
    END curpick;
    FUNCTION wkdays(p_first_of_month IN DATE)
    RETURN NUMBER IS p_wk NUMBER;
    BEGIN
    vc_FirstofMonth := p_first_of_month;
    SELECT COUNT(service_date) AS
    wk
    INTO p_wk
    FROM
    (SELECT DISTINCT service_date
    FROM bus_daily_rides
    WHERE to_char(service_date,'MM-YYYY') = to_char(vc_firstofmonth,'MM-YYYY')
    AND day_type = 'W')
    RETURN p_wk;
    END wkdays;
    FUNCTION sadays (p_first_of_month IN DATE)
    RETURN NUMBER IS p_sa NUMBER;
    BEGIN
    vc_FirstofMonth := p_first_of_month;
    SELECT COUNT(service_date) AS
    sa
    INTO p_sa
    FROM
    (SELECT DISTINCT service_date
    FROM bus_daily_rides
    WHERE to_char(service_date, 'MM-YYYY') = to_char(vc_firstofmonth, 'MM-YYYY')
    AND day_type = 'A')
    RETURN p_sa;
    END sadays;
    FUNCTION sudays(p_first_of_month IN DATE)
    RETURN NUMBER IS p_su NUMBER;
    BEGIN
    vc_FirstofMonth := p_first_of_month;
    SELECT COUNT(service_date) AS
    su
    INTO p_su
    FROM
    (SELECT DISTINCT service_date
    FROM bus_daily_rides
    WHERE to_char(service_date, 'MM-YYYY') = to_char(vc_firstofmonth, 'MM-YYYY')
    AND day_type = 'U')
    RETURN p_su;
    END sudays;
    FUNCTION wkdaysminusone(p_first_of_month IN DATE)
    RETURN NUMBER IS p_wkone NUMBER;
    BEGIN
    vc_FirstofMonth := p_first_of_month;
    SELECT COUNT(*) AS
    wkone
    INTO p_wkone
    FROM
    (SELECT DISTINCT to_char(add_months(service_date, -12), 'dd-mm-yyyy')
    FROM bus_daily_rides
    WHERE to_char(service_date, 'mm-yyyy') = to_char(vc_firstofmonth, 'MM-YYYY')
    AND day_type = 'W')
    RETURN p_wkone;
    END wkdaysminusone;
    FUNCTION sadaysminusone(p_first_of_month IN DATE)
    RETURN NUMBER IS p_saone NUMBER;
    BEGIN
    vc_FirstofMonth := p_first_of_month;
    SELECT COUNT(*) AS
    saone
    INTO p_saone
    FROM
    (SELECT DISTINCT to_char(add_months(service_date, -24), 'dd-mm-yyyy')
    FROM bus_daily_rides
    WHERE to_char(service_date, 'mm-yyyy') = to_char(vc_firstofmonth, 'MM-YYYY')
    AND day_type = 'A')
    RETURN p_saone;
    END sadaysminusone;
    FUNCTION sudaysminusone(p_first_of_month IN DATE)
    RETURN NUMBER IS p_suone NUMBER;
    BEGIN
    vc_FirstofMonth := p_first_of_month;
    SELECT COUNT(*) AS
    suone
    INTO p_suone
    FROM
    (SELECT DISTINCT to_char(add_months(service_date, -12), 'dd-mm-yyyy')
    FROM bus_daily_rides
    WHERE to_char(service_date, 'mm-yyyy') = to_char(vc_firstofmonth, 'MM-YYYY')
    AND day_type = 'U')
    RETURN p_suone;
    END sudaysminusone;
    FUNCTION wkdaysminustwo(p_first_of_month IN DATE)
    RETURN NUMBER IS p_wktwo NUMBER;
    BEGIN
    vc_FirstofMonth := p_first_of_month;
    SELECT COUNT(*) AS
    wktwo
    INTO p_wktwo
    FROM
    (SELECT DISTINCT to_char(add_months(service_date, -24), 'dd-mm-yyyy')
    FROM bus_daily_rides
    WHERE to_char(service_date, 'mm-yyyy') = to_char(vc_FirstofMonth, 'MM-YYYY')
    AND day_type = 'W')
    RETURN p_wktwo;
    END wkdaysminustwo;
    FUNCTION sadaysminustwo(p_first_of_month IN DATE)
    RETURN NUMBER IS p_satwo NUMBER;
    BEGIN
    vc_FirstofMonth := p_first_of_month;
    SELECT COUNT(*) AS
    satwo
    INTO p_satwo
    FROM
    (SELECT DISTINCT to_char(add_months(service_date, -24), 'dd-mm-yyyy')
    FROM bus_daily_rides
    WHERE to_char(service_date, 'mm-yyyy') = to_char(vc_firstofmonth, 'MM-YYYY')
    AND day_type = 'A')
    RETURN p_satwo;
    END sadaysminustwo;
    FUNCTION sudaysminustwo(p_first_of_month IN DATE)
    RETURN NUMBER IS p_sutwo NUMBER;
    BEGIN
    vc_FirstofMonth := p_first_of_month;
    SELECT COUNT(*) AS
    sutwo
    INTO p_sutwo
    FROM
    (SELECT DISTINCT to_char(add_months(service_date, -24), 'dd-mm-yyyy')
    FROM bus_daily_rides
    WHERE to_char(service_date, 'mm-yyyy') = to_char(vc_firstofmonth, 'MM-YYYY')
    AND day_type = 'U')
    RETURN p_sutwo;
    END sudaysminustwo;
    /*PICK_DATE determines if the report being provided takes place during a pick month.*/
    PROCEDURE pick_date(p_first_of_month IN DATE)
    AS
    BEGIN
    vc_firstofmonth := p_first_of_month;
    vc_currentpick := curpick();
    IF to_char(vc_firstofmonth, 'MM-YYYY') <> to_char(vc_currentpick, 'MM-YYYY') THEN
    accessreports.exec_reports(p_first_of_month);
    ELSE
    NULL;
    /*This procedure being built*/
    END IF;
    END pick_date;
    /*EXEC_REPORTS executes the procs below it with two input vars.*/
    PROCEDURE exec_reports(p_first_of_month IN DATE)
    IS
    BEGIN
    accessreports.productivity_insert(p_first_of_month);
    accessreports.average_boardings(p_first_of_month);
    END;
    /*Last two procs use dynamic SQL to rotate through the different day types and
    pls_integer of days for each day type.*/
    PROCEDURE productivity_insert(p_first_of_month DATE)
    AS
    TYPE daylist IS TABLE OF VARCHAR2(1);
    DAYS daylist := daylist('W', 'A', 'U');
    TYPE countlist IS TABLE OF NUMBER;
    counts countlist := countlist(wkdays(), sadays(), sudays());
    BEGIN
    FOR i IN 1 .. 3 LOOP
    EXECUTE IMMEDIATE 'INSERT INTO RFC_BUS' || DAYS(i) || 'PRODUCTIVITY(ROUTE,PPPH)
    SELECT a.route, ((sr05 / sy05)/' || counts(i) || ') AS "RATIO"
    FROM (SELECT route,
    SUM (DECODE (TO_CHAR (pick, "MM-YYYY"),
    to_char(vc_FirstofMonth, "MM-YYYY"), platform_hours, null)) AS sy05
    FROM bus_platformhours
    WHERE day_type =' || DAYS(i) || ' and platform_hours > 0
    GROUP BY route) a,
    (SELECT route,
    SUM (DECODE (TO_CHAR (service_date, "mm-yyyy"),
    to_char(vc_FirstofMonth, "MM-YYYY"), rides, null)) AS sr05
    FROM bush_daily_rides
    WHERE day_type = ' || DAYS(i) || 'GROUP BY route) b
    WHERE a.route = b.route
    ORDER BY a.route
    VALUES(
    p_route,
    p_ratio
    ) USING days(i), counts(i)';
    END LOOP;
    END productivity_insert;
    PROCEDURE average_boardings(p_first_of_month DATE)
    AS
    type daylist IS TABLE OF VARCHAR2(1);
    DAYS daylist := daylist('W', 'A', 'U');
    type countlist IS TABLE OF NUMBER;
    counts countlist := countlist(wkdays(), sadays(), sudays());
    type dayonelist IS TABLE OF NUMBER;
    dayone dayonelist := dayonelist(wkdaysminusone(), sadaysminusone(), sudaysminusone());
    type daytwolist IS TABLE OF NUMBER;
    daytwo daytwolist := daytwolist(wkdaysminustwo(), sadaysminustwo(), sudaysminustwo());
    BEGIN
    vc_firstofmonth := p_first_of_month;
    FOR i IN 1 .. 3 LOOP
    EXECUTE IMMEDIATE 'INSERT INTO RFC' || DAYS(i) || 'BUSAVG_RIDES_AND_PROD(ROUTE, THIRD_YEAR, SECOND_YEAR, PRESENT_YEAR,
    PER_DIFF_THIRDTOPRESENT, PER_DIFF_SECONDTOPRESENT, ROUTETWO, PASS_PLAT_HOUR)
    select r.*,
    t2.*
    from (
    select *
    from (select route,
    sum(y04)/' || counts(i) || ' y04,
    sum(y05)/' || dayone(i) || ' y05,
    sum(y06)/' || daytwo(i) || ' y06,
    decode(sum(y04),0,0,(sum(y06)-sum(y04))/sum(y04)*100) Percent_difference_04to06,
    decode(sum(y05),0,0,(sum(y06)-sum(y05))/sum(y05)*100) Percent_difference_05to06
    from (select route,
         decode(to_char(service_date,"yy"),"04",Rides,0) y04,
    decode(to_char(service_date,"yy"),"05",Rides,0) y05,
         decode(to_char(service_date,"yy"),"06",Rides,0) y06
    from bus_daily_rides
    where TO_CHAR(service_date, "YY") IN ("04","05", "06")
    AND TO_CHAR(SERVICE_DATE,"MM")=TO_CHAR(vc_FirstofMonth, "MM")
    AND day_type=' || DAYS(i) || '
    group by route
    WHERE ROWNUM > 0
    ) r,
    ' || DAYS(i) || '"_"Route_productivity t2
    where t2.route = r.route
    VALUES(p_route,
    p_third_year,
    p_second_year,
    p_present_year,
    p_thirdtopresent,
    p_secondtopresent,
    p_routetwo,
    p_ppph) USING counts(i), days(i), daysone(i), daystwo(i)';
    END LOOP;
    END;
    END accessreports;

  • Function Call returning old SQL Query

    Hello All,
    I have a Pipeline Function which creates a SQL within (Dynamic SQL that gets stored in a LONG variable) based on the parameter STRING passed to the function. Inside this function, once the SQL is built, I am inserting this SQL into a log table, for logging purpose.
    Note: my function has only one parameter which is a string. This string accepts a name:value pairs with a delimiter which I breakdown inside the function. But this functionality is working fine.
    Issue:
    When I run the function with parameter with a STRING say (Age = 20, Gender = M) for the first time, it works.
    <code>SELECT * FROM TABLE (
    PIPE_FUN_SEARCH_PKG.get_search_records ('EMP_AGE:20|EMP_GENDER:M'));
    </code>
    When I change the parameters to (Age = 20, Gender = F), it gives me the results of the earlier function call.
    <code>SELECT * FROM TABLE (
    PIPE_FUN_SEARCH_PKG.get_search_records ('EMP_AGE:20|EMP_GENDER:F'));
    </code>
    When I open the logs, I see the SQL being built is the earlier one.
    As a test I closed the session and ran (Age = 20, Gender = F) first. It works fine. When I run a different parameter string, it always mimics the earlier function call.
    Is CACHING in play here. I tried both the following:
    <code> dbms_result_cache.bypass(FALSE);
    dbms_result_cache.flush;
    </code>
    I tried multiple tests, with different parameters and only the first one runs fine and second one copied the earlier. However, when I open two sessions on two different windows it doesn't happen.
    Also, in the Logging table I am capturing the input string as a confirmation, which is coming correctly. But the SQL being build mimics the earlier call.
    I tried to set the variable which hold the SQL Statement to empty (v_sql := '';) at the beginning and also at the end. Still no use.
    Kindly help if I am over looking anything.
    Regards,
    Aj

    Aj09 wrote:
    I have a Pipeline Function which creates a SQL within (Dynamic SQL that gets stored in a LONG variable) based on the parameter STRING passed to the function. The LONG data type has been replaced by the LOB data type. Oracle specifically recommends not using the old LONG data type.
    Issue:
    When I run the function with parameter with a STRING say (Age = 20, Gender = M) for the first time, it works.
    <code>SELECT * FROM TABLE (
    PIPE_FUN_SEARCH_PKG.get_search_records ('EMP_AGE:20|EMP_GENDER:M'));
    </code>
    When I change the parameters to (Age = 20, Gender = F), it gives me the results of the earlier function call.
    <code>SELECT * FROM TABLE (
    PIPE_FUN_SEARCH_PKG.get_search_records ('EMP_AGE:20|EMP_GENDER:F'));
    </code>The tag is ** - not *<code>*.
    Why a pipeline function? Why dynamic SQL? Are you using +DBMS_SQL+ to create the dynamic cursor? If not, why not? Only +DBMS_SQL+ allows dynamic binding in PL/SQL. Without that, your code will burn a lot of additional CPU on hard parsing and trash and fragment Shared Pool memory.
    When I open the logs, I see the SQL being built is the earlier one.
    How do you record the current SQL? Are you using a static variable to capture the SQL statement generated?
    From what you have described - this is yet another horribly flawed approach in all respects. To data modelling. To relational databases. To Oracle. To SQL.
    Reinventing the SQL language for data retrieval as a pipeline function using a funky parameter interface - sorry, I just don't get that. It is an insane approach.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Java.lang.VerifyError - Incompatible object argument for function call

    Hi all,
    I'm developing a JSP application (powered by Tomcat 4.0.1 in JDK 1.3, in Eclipse 3.3). Among other stuff I have 3 classes interacting with an Oracle database, covering 3 use cases - renaming, adding and deleting an database object. The renaming class simply updates the database with a String variable it receives from the request object, whereas the other two classes perform some calculations with the request data and update the database accordingly.
    When the adding or deleting classes are executed, by performing the appropriate actions through the web application, Tomcat throws the following:
    java.lang.VerifyError: (class: action/GliederungNewAction, method: insertNewNode signature: (Loracle/jdbc/driver/OracleConnection;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V) Incompatible object argument for function call
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:120)
         at action.ActionMapping.perform(ActionMapping.java:53)
         at ControllerServlet.doResponse(ControllerServlet.java:92)
         at ControllerServlet.doPost(ControllerServlet.java:50)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    ...The renaming works fine though. I have checked mailing lists and forums as well as contacted the company's java support but everything I have tried out so far, from exchanging the xerces.jar files found in JDOM and Tomcat to rebuidling the project didn't help.
    I just can't explain to myself why this error occurs and I don't see how some additional Java code in the other 2 classes could cause it?
    I realize that the Tomcat and JDK versions I'm using are totally out of date, but that's company's current standard and I can't really change that.
    Here's the source code. I moved parts of the business logic from Java to Oracle recently but I left the SQL statements that the Oracle stored procedures are executing if it helps someone.
    package action;
    import java.sql.CallableStatement;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.StringTokenizer;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    import oracle.jdbc.driver.OracleConnection;
    * This class enables the creation and insertion of a new catalogue node. A new node
    * is always inserted as the last child of the selected parent node.
    public class GliederungNewAction implements Action {
         public String perform(ActionMapping mapping, HttpServletRequest request,
                   HttpServletResponse response) {
              // fetch the necessary parameters from the JSP site
              // the parent attribute is the selected attribute!
              String parent_attribute = request.getParameter("attr");
              String catalogue = request.getParameter("catalogue");
              int parent_sequenceNr = Integer.parseInt(request.getParameter("sort_sequence"));
              // connect to database    
              HttpSession session = request.getSession();   
              db.SessionConnection sessConn = (db.SessionConnection) session.getAttribute("connection");
              if (sessConn != null) {
                   try {
                        sessConn.setAutoCommit(false);
                        OracleConnection connection = (OracleConnection)sessConn.getConnection();
                        int lastPosition = getLastNodePosition( getLastChildAttribute(connection, catalogue, parent_attribute) );
                        String newNodeAttribute = createNewNodeAttribute(parent_attribute, lastPosition);
                        // calculate the sequence number
                        int precedingSequenceNumber = getPrecedingSequenceNumber(connection, catalogue, parent_attribute);
                        if ( precedingSequenceNumber == -1 ) {
                             precedingSequenceNumber = parent_sequenceNr;
                        int sortSequence = precedingSequenceNumber + 1;
                        setSequenceNumbers(connection, catalogue, sortSequence);
                        // insert the new node into DB
                        insertNewNode(connection, catalogue, newNodeAttribute, parent_attribute, "Neuer Punkt", sortSequence);
                        connection.commit();
                   } catch(SQLException ex) {
                        ex.printStackTrace();
              return mapping.getForward();
          * Creates, fills and executes a prepared statement to insert a new entry into the specified table, representing
          * a new node in the catalogue.
         private void insertNewNode(OracleConnection connection, String catalogue, String attribute, String parent_attribute, String description, int sortSequence) {
              try {
                   String callAddNode = "{ call fasi_lob.pack_gliederung.addNode(:1, :2, :3, :4, :5) }";
                   CallableStatement cst;
                   cst = connection.prepareCall(callAddNode);
                   cst.setString(1, catalogue);
                   cst.setString(2, attribute);
                   cst.setString(3, parent_attribute);
                   cst.setString(4, description);
                   cst.setInt(5, sortSequence);
                   cst.execute();
                   cst.close();
              } catch (SQLException e1) {
                   // TODO Auto-generated catch block
                   e1.printStackTrace();
    //          String insertNewNode = "INSERT INTO vstd_media_cat_attributes " +
    //                    "(catalogue, attribute, parent_attr, description, sort_sequence) VALUES(:1, :2, :3, :4, :5)";
    //          PreparedStatement insertStmt;
    //          try {
    //               insertStmt = connection.prepareStatement(insertNewNode);
    //               insertStmt.setString(1, catalogue);
    //               insertStmt.setString(2, attribute);
    //               insertStmt.setString(3, parent_attribute);
    //               insertStmt.setString(4, description);
    //               insertStmt.setInt(5, sortSequence);
    //               insertStmt.execute();
    //               insertStmt.close();
    //          } catch (SQLException e) {
    //               e.printStackTrace();
          * This method returns the attribute value of the last child of the parent under which
          * we want to insert a new node. The result set is sorted in descending order and only the
          * first result (that is, the last child under this parent) is fetched.
          * If the parent node has no children, "parent_attr.0" is returned. 
          * @param connection
          * @param catalogue
          * @param parent_attribute
          * @return attribute of the last child under this parent, or "parent_attr.0" if parent has no children
         private String getLastChildAttribute(OracleConnection connection, String catalogue, String parent_attribute) {
              String queryLastChild = "SELECT attribute FROM vstd_media_cat_attributes " +
                                            "WHERE catalogue=:1 AND parent_attr=:2 ORDER BY sort_sequence DESC";
              String lastChildAttribute;
              PreparedStatement ps;
              try {
                   ps = connection.prepareStatement(queryLastChild);
                   ps.setString(1, catalogue);
                   ps.setString(2, parent_attribute);
                   ResultSet rs = ps.executeQuery();
                   /* If a result is returned, the selected parent already has children.
                    * If not set the lastChildAttribute to parent_attr.0
                   if (rs.next()) {
                        lastChildAttribute = rs.getString("attribute");
                   } else {
                        lastChildAttribute = parent_attribute.concat(".0");
                   rs.close();
                   return lastChildAttribute;
              } catch (SQLException e) {
                   e.printStackTrace();
                   return null;
          * This helper method determines the position of the last node in the attribute.
          * i.e for 3.5.2 it returns 2, for 2.1 it returns 1 etc.
          * @param attribute
          * @return position of last node in this attribute
         private int getLastNodePosition(String attribute) {
              StringTokenizer tokenizer = new StringTokenizer(attribute, ".");
              String lastNodePosition = "0";
              while( tokenizer.hasMoreTokens() ) {
                   lastNodePosition = tokenizer.nextToken();
              return Integer.parseInt(lastNodePosition);
          * This method calculates the attribute of a node being inserted
          * by incrementing the last child position by 1 and attaching the
          * incremented position to the parent.
          * @param parent_attr
          * @param lastPosition
          * @return attribute of the new node
         private String createNewNodeAttribute(String parent_attr, int lastPosition) {
              String newPosition = new Integer(lastPosition + 1).toString();
              return parent_attr.concat("." + newPosition);
          * This method checks if the required sequence number for a new node is already in use and
          * handles the sequence numbers accordingly.
          * If the sequence number for a new node is NOT IN USE, the method doesn't do anything.
          * If the sequence number for a new node is IN USE, the method searches for the next free
          * sequence number by incrementing the number by one and repeating the query until no result
          * is found. Then all the sequence numbers between the required number (including, >= relation)
          * and the nearest found free number (not including, < relation) are incremented by 1, as to
          * make space for the new node.
          * @param connection
          * @param catalogue
          * @param newNodeSequenceNumber required sequence number for the new node
         private void setSequenceNumbers(OracleConnection connection, String catalogue, int newNodeSequenceNumber) {
              // 1. check if the new sequence number exists - if no do nothing
              // if yes - increment by one and see if exists
              //           repeat until free sequence number exists
              // when found increment all sequence numbers freeSeqNr > seqNr >= newSeqNr
              String query = "SELECT sort_sequence FROM vstd_media_cat_attributes " +
                        "WHERE catalogue=:1 AND sort_sequence=:2";
              PreparedStatement ps;
              try {
                   ps = connection.prepareStatement(query);
                   ps.setString(1, catalogue);
                   ps.setInt(2, newNodeSequenceNumber);               
                   ResultSet rs = ps.executeQuery();
                   // if no result, the required sequence number is free - nothing to do
                   if( rs.next() ) {
                        int freeSequenceNumber = newNodeSequenceNumber;
                        do {
                             ps.setString(1, catalogue);
                             ps.setInt(2, freeSequenceNumber++);
                             rs = ps.executeQuery();
                        } while( rs.next() );
                        // increment sequence numbers - call stored procedure
                        String callUpdateSeqeunceNrs = "{ call fasi_lob.pack_gliederung.updateSeqNumbers(:1, :2, :3) }";
                        CallableStatement cst = connection.prepareCall(callUpdateSeqeunceNrs);
                        cst.setString(1, catalogue);
                        cst.setInt(2, newNodeSequenceNumber);
                        cst.setInt(3, freeSequenceNumber);
                        cst.execute();
                        cst.close();
    //                    String query2 = "UPDATE vstd_media_cat_attributes " +
    //                                      "SET sort_sequence = (sort_sequence + 1 ) " +
    //                                      "WHERE catalogue=:1 sort_sequnce >=:2 AND sort_sequence <:3";
    //                    PreparedStatement ps2;
    //                    ps2 = connection.prepareStatement(query2);
    //                    ps2.setString(1, catalogue);
    //                    ps2.setInt(2, newNodeSequenceNumber);
    //                    ps2.setInt(3, freeSequenceNumber);
    //                    ps.executeUpdate();
    //                    ps.close();
                   } // end of if block
                   rs.close();
              } catch (SQLException e) {
                   e.printStackTrace();
          * This method finds the last sequence number preceding the sequence number of a node
          * that is going to be inserted. The preceding sequence number is required to calculate
          * the sequence number of the new node.
          * We perform a hierarchical query starting from the parent node: if a result is returned,
          * we assign the parent's farthest descendant's node sequence number; if no result
          * is returned, we assign the parent's sequence number.
          * @param connection
          * @param catalogue
          * @param parent_attr parent attribute of the new node
          * @return
         private int getPrecedingSequenceNumber(OracleConnection connection, String catalogue, String parent_attr) {
              int sequenceNumber = 0;
              String query = "SELECT sort_sequence FROM vstd_media_cat_attributes " +
                                "WHERE catalogue=:1 " +
                                "CONNECT BY PRIOR attribute = parent_attr START WITH parent_attr=:2 " +
                                "ORDER BY sort_sequence DESC";
              try {
                   PreparedStatement ps = connection.prepareStatement(query);
                   ps.setString(1, catalogue);
                   ps.setString(2, parent_attr);
                   ResultSet rs = ps.executeQuery();
                   if ( rs.next() ) {
                        sequenceNumber = rs.getInt("sort_sequence");
                   } else {
                        // TODO: ggf fetch from request!
                        sequenceNumber = -1;
                   rs.close();
                   ps.close();
              } catch (SQLException e) {
                   e.printStackTrace();
              return sequenceNumber;
    }

    After further googling I figured out what was causing the problem: in eclipse I was referring to external libraries located in eclipse/plugins directory, whereas Tomcat was referring to the same libraries (possibly older versions) in it's common/lib directory.

  • Java function call from Trigger in Oracle

    Moderator edit:
    This post was branched from an eleven-year-old long dead thread
    Java function call from Trigger in Oracle
    @ user 861498,
    For the future, if a forum discussion is more than (let's say) a month old, NEVER resurrect it to append your new issue. Always start a new thread. Feel free to include a link to that old discussion if you think it might be relevant.
    Also, ALWAYS use code tags as is described in the forum FAQ that is linked at the upper corner of e\very page. Your formulae will be so very much more readable.
    {end of edit, what follows is their posting}
    I am attempting to do a similar function, however everything is loaded, written, compiled and resolved correct, however, nothing is happening. No errors or anything. Would I have a permission issue or something?
    My code is the following, (the last four lines of java code is meant to do activate a particular badge which will later be dynamic)
    Trigger:
    CREATE OR REPLACE PROCEDURE java_contact_t4 (member_id_in NUMBER)
    IS LANGUAGE JAVA
    NAME 'ThrowAnError.contactTrigger(java.lang.Integer)';
    Java:
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "ThrowAnError" AS
    // Required class libraries.
    import java.sql.*;
    import oracle.jdbc.driver.*;
    import com.ekahau.common.sdk.*;
    import com.ekahau.engine.sdk.*;
    // Define class.
    public class ThrowAnError {
    // Connect and verify new insert would be a duplicate.
    public static void contactTrigger(Integer memberID) throws Exception {
    String badgeId;
    // Create a Java 5 and Oracle 11g connection.
    Connection conn = DriverManager.getConnection("jdbc:default:connection:");
    // Create a prepared statement that accepts binding a number.
    PreparedStatement ps = conn.prepareStatement("SELECT \"Note\" " +
    "FROM Users " +
    "WHERE \"User\" = ? ");
    // Bind the local variable to the statement placeholder.
    ps.setInt(1, memberID);
    // Execute query and check if there is a second value.
    ResultSet rs = ps.executeQuery();
    while (rs.next()) {
    badgeId = rs.getString("Note");
    // Clean up resources.
    rs.close();
    ps.close();
    conn.close();
    // davids badge is 105463705637
    EConnection mEngineConnection = new econnection("10.25.10.5",8550);
    mEngineConnection.setUserCredentials("choff", "badge00");
    mEngineConnection.call("/epe/cfg/tagcommandadd?tagid=105463705637&cmd=mmt%203");
    mEngineConnection.call("/epe/msg/tagsendmsg?tagid=105463705637&messagetype=instant&message=Hello%20World%20from%20Axium-Oracle");
    Edited by: rukbat on May 31, 2011 1:12 PM

    To followup on the posting:
    Okay, being a oracle noob, I didn't know I needed to tell anything to get the java error messages out to the console
    Having figured that out on my own, I minified my code to just run the one line of code:
    // Required class libraries.
      import java.sql.*;
      import oracle.jdbc.driver.*;
      import com.ekahau.common.sdk.*;
      import com.ekahau.engine.sdk.*;
      // Define class.
      public class ThrowAnError {
         public static void testEkahau(Integer memberID) throws Exception {
         try {
              EConnection mEngineConnection = new EConnection("10.25.10.5",8550);
         } catch (Throwable e) {
              System.out.println("got an error");
              e.printStackTrace();
    }So, after the following:
    SQL> {as sysdba on another command prompt} exec dbms_java.grant_permission('AXIUM',"SYS:java.util.PropertyPermission','javax.security.auth.usersubjectCredsOnly','write');
    and the following as the user
    SQL> set serveroutput on
    SQL> exec dbms_java.set_output(10000);
    I run the procedure and receive the following message.
    SQL> call java_contact_t4(801);
    got an error
    java.lang.NoClassDefFoundError
         at ThrowAnError.testEkahau(ThrowAnError:13)
    Call completed.
    NoClassDefFoundError tells me that it can't find the jar file to run my call to EConnection.
    Now, I've notice when I loaded the sdk jar file, it skipped some classes it contained:
    c:\Users\me\Documents>loadjava -r -f -v -r "axium/-----@axaxiumtrain" ekahau-engine-sdk.jar
    arguments: '-u' 'axium/***@axaxiumtrain' '-r' '-f' '-v' 'ekahau-engine-sdk.jar'
    creating : resource META-INF/MANIFEST.MF
    loading : resource META-INF/MANIFEST.MF
    creating : class com/ekahau/common/sdk/EConnection
    loading : class com/ekahau/common/sdk/EConnection
    creating : class com/ekahau/common/sdk/EErrorCodes
    loading : class com/ekahau/common/sdk/EErrorCodes
    skipping : resource META-INF/MANIFEST.MF
    resolving: class com/ekahau/common/sdk/EConnection
    skipping : class com/ekahau/common/sdk/EErrorCodes
    skipping : class com/ekahau/common/sdk/EException
    skipping : class com/ekahau/common/sdk/EMsg$EMSGIterator
    skipping : class com/ekahau/common/sdk/EMsg
    skipping : class com/ekahau/common/sdk/EMsgEncoder
    skipping : class com/ekahau/common/sdk/EMsgKeyValueParser
    skipping : class com/ekahau/common/sdk/EMsgProperty
    resolving: class com/ekahau/engine/sdk/impl/LocationImpl
    skipping : class com/ekahau/engine/sdk/status/IStatusListener
    skipping : class com/ekahau/engine/sdk/status/StatusChangeEntry
    Classes Loaded: 114
    Resources Loaded: 1
    Sources Loaded: 0
    Published Interfaces: 0
    Classes generated: 0
    Classes skipped: 0
    Synonyms Created: 0
    Errors: 0
    .... with no explanation.
    Can anyone tell me why it would skip resolving a class? Especially after I use the -r flag to have loadjava resolve it upon loading.
    How do i get it to resolve the entire jar file?
    Edited by: themadprogrammer on Aug 5, 2011 7:15 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:21 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:22 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:23 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:26 AM

  • Function call in CMOD

    Dear All,
    I am using Resrticted Key figure (RKF) in report which is having one customer exit variable on date field/infoobject.
    Now there is a need to use two function module for this customer exit.
    Scenario:-
    Depending upon the input value given for normal input variable i.e. year, RKF will show value for that specific date.
    Now here i am using function module 'DATE_TO_PERIOD_CONVERT', after this function module gets executed i also want to call function module 'SLS_MISC_GET_LAST_DAY_OF_MONTH'.
    But when i do this my report does not run at all. When i comment this function call then it works perfectly fine with first function call.
    I am not sure if we can call two function module together for one specific customer exit variable. Or there is a problem with 'SLS_MISC_GET_LAST_DAY_OF_MONTH' function module. This function works well when we execute the same in se37.
    Can you guide me on how can i use both function module?
    Thanks & Regards,
    Anup

    Hi,
    Thanks a lot for reply.
    Function " SLS_MISC_GET_LAST_DAY_OF_MONTH " was not remote enabled.
    Its working fine now.
    Thanks & Regards,
    Anup

  • Preloading and initialization of function calls brings response to a halt

    I am creating a form with many CFC calls to the server.
    However, on initial load, I am calling all these functions so that
    my detailregion which relies on the result set from these
    function calls would not error out. These initial functions do not
    return any results - there exist to satify the regiondetail
    bindings.
    Eg. my initialization calls
    var getEmployees = new Spry.Data.XMLDataSet(someCFCFile,
    "employees/employee_id", { useCache: false });
    var getDocs = new Spry.Data.XMLDataSet(someCFCFile,
    "employees/employee_id", { useCache: false });
    My issue is that the number of calls I am making are causing
    the page to take 15+ seconds to load. I can't do without them
    because my regiondetail rely on them initially. And also, later on,
    my code uses these variables to make other calls Eg.
    getEmployees .setURL(someCFCFile);
    I have tried to perform these initial call with a null value,
    but IE is still taking just as long to process these calls.
    Eg.
    var getEmployees = new Spry.Data.XMLDataSet(NULL,
    "employees/employee_id", { useCache: false });
    Please help. Thanks.

    Either Restrict Access or a Send Email Instance. Once I have tried to add either one of these to a page or successfully added, then I can't use ADDT at all.
    For instance I click on any of the Wizards to run them, I get a ADDT window with the word loading across it. It sits and spins.
    I have spent all afternoon trying to just get back to where I can work with ADDT again normally. The only way I have found that ADDT will work again after trying to utilize the email function or the Login function is to delete all of the ADDT include files and re-install.
    Not very time affective.

  • Noob question on function calls

    I just converted a script from VBScript and wrote the function calls to look the same. The problem is the functions don't work as expected.
    Here is my function to delete some characters I don't want from a string, and return the string back to me. I'm sure there is some very simple issue with the variable / object references that is the reason why the input string gets passed back unaltered,
    even if it contains spaces or single quote marks.
    This function is part of a section of code which converts people's names into logon names, by removing spaces and illegal characters from the names.
    function CleanString($InputStr)
        $DirtyChars = "?", "/", "\", ":", "*", '", "<", ">", ",", "&", "#", "~", "%", "{", "}",
    "+", "_", ".", `', " "
        foreach ($char in $DirtyChars)
            $InputStr = $InputStr.Replace($char,"")
        return $InputStr

    Hi there,
    It look like there's a problem with your $DirtyChars variable:
    DirtyChars = "?", "/", "\", ":", "*",
    '", "<", ">", ",", "&", "#", "~", "%", "{", "}", "+", "_",
    ".", `', " "

  • Function Call Syntax

    What is the proper syntax to assign the value returned from a function call to a variable when that function is called within a procedure withing a package.
    My example Procedure looks like the following :
    The function that I am calling is "FNC_CURRENT_TIME_ID" in the package "tst_UI_Queries". I have tried the following....
    PROCEDURE QRY_CURRENT_TIME_ID(o_Time_ID               int)
    IS
    BEGIN
         o_Time_ID := exec tst_UI_Queries.FNC_CURRENT_TIME_ID;
         RETURN o_Time_ID;
    END QRY_CURRENT_TIME_ID;      
    I have also tried...
    exec txt_UI_Queries.FNC_Current_TIME_ID INTO o_Time_ID;
    Does not seem to like either...
    Thanks inadvance for your assistance!!!

    IF you are assigning the return value to the o_Time_ID, which is an input parameter to the procedure QRY_CURRENT_TIME_ID, you must make it an OUT or IN OUT to be able to assign the value.

  • Parallel function call and thread issue

    Sorry to post one issue here which is related to code. i was debugging a code which was wrote long time back by one developer. the issue is two function is called parallel using thread and one function set a variable true at end and another function just
    looping until the variable is set to true. the variable value is not getting set to true. here i am posting a code snippet and just tell me what is mistake in the code for which variable is not getting set to true by first function.
    when user click button then two function is invoked
    private void UPDATE_Click(object sender, System.EventArgs e)
    SavedFirst();
    AddCheckThread();
    public void SavedFirst()
    IsOpen = true;
    System.Threading.Thread loadT = new System.Threading.Thread(new System.Threading.ThreadStart(SaveAll));
    loadT.Start();
    IsOpen = false;
    private void AddCheckThread()
    if (!ALLFlag)
    loadingThread = new System.Threading.Thread(new System.Threading.ThreadStart(addCheck));
    loadingThread.Priority = System.Threading.ThreadPriority.Lowest;
    loadingThread.Start();
    private void SaveAll()
    if (this.InvokeRequired)
    this.Invoke(new MethodInvoker(delegate
    ALLFlag = false;
    if (!ALLFlag)
    loadingThread = new System.Threading.Thread(new System.Threading.ThreadStart(AddProducts));
    loadingThread.Priority = System.Threading.ThreadPriority.Lowest;
    loadingThread.Start();
    return;
    private void AddProducts()
    if (this.InvokeRequired)
    this.Invoke(new MethodInvoker(delegate
    ALLFlag = false;
    if (System.Windows.Forms.MessageBox.Show(this, "Would you like to add the details into the Database?", "Add?", System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
    if (comboOUR.SelectedItem == null || comboCountry.SelectedItem == null || comboSelleble.SelectedItem == null || txtOereff.Text == "" || txtUKPrice.Text == "" || txtUSPrice.Text == "" || txtSUrCharge.Text == "" || txtOURUS.Text == "" || txtOURUK.Text == "")
    FormValidation();
    else
    Gather_Data();
    bool isInserted = false;
    if (System.Windows.Forms.MessageBox.Show(this, "Would you like to add the details into \"Detailed-Product\" Too?", "Add?", System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
    isInserted = bbaProduct.BBASaveProduct();
    if (isInserted == true)
    isInserted = false;
    isInserted = bbaProduct.InsertInProductTable(BBAProduct.DetailProductID);
    if (isInserted == true)
    System.Windows.Forms.MessageBox.Show(this, "Product Successfully Added ", "Add");
    else
    System.Windows.Forms.MessageBox.Show(this, "Error Occurred !! Not Added Into the Database ", "Add");
    else
    System.Windows.Forms.MessageBox.Show(this, "Error Occurred !! Not Added Into the Database ", "Add");
    else
    isInserted = bbaProduct.InsertInProductTable(0);
    if (isInserted == true)
    System.Windows.Forms.MessageBox.Show(this, "Successfully Inserted Into the database", "Add");
    else
    System.Windows.Forms.MessageBox.Show(this, "Error Occurred !! Not Added Into the Database", "Add");
    else
    System.Windows.Forms.MessageBox.Show(this, "Process Cancelled By The User", "Add");
    ALLFlag = true;
    return;
    #region Add Check
    private void addCheck()
    if (this.InvokeRequired)
    this.Invoke(new MethodInvoker(delegate
    this.Opacity = 0.8;
    axShockwaveFlash1.Visible = true;
    axShockwaveFlash1.Play();
    while (!ALLFlag)
    int x = 0;
    axShockwaveFlash1.Visible = false;
    axShockwaveFlash1.Visible = false;
    axShockwaveFlash1.StopPlay();
    this.Opacity = 1;
    ALLFlag = false;
    loadingThread.Abort();
    return;
    help me to locate where is the mistake for which ALLFlag value is not getting set to true. thanks

    Your reliance on a field value across threads isn't going to work reliably.  In a multi-core/multi-threaded world the memory model allows for reading data out of order for optimization reasons.  Additionally the CPU can and will cache recently
    used data in memory that isn't shared across processors.  This can get you into trouble as you will not be reading the same value across processors.
    The only correct way to ensure that multiple threads access the same data correctly is to use sync objects that are designed for that such as a Semaphore or Mutex.  Sync objects allow you to safely share data across threads.
    Overall your code appears to be trying to update the UI using a thread but since it is calling Invoke each time you are basically spawning a thread that then blocks waiting for the UI thread.  You could pretty much eliminate your issues by getting rid
    of the threading calls altogether along with any sort of state management variables that were arbitrarily created (ALLflags) and simply use BeginInvoke.  You didn't post who was calling your higher level save methods but if it is a UI element then BeginInvoke
    and InvokeRequired are completely redundant as is all the threading.
    You can cleanly update this code to eliminate all the extra variables and threading and simply use the newer async/await functionality to help resolve the issues your code is having.  But you still have problems with the invoked code.  In one of
    the methods you are looping while waiting for a variable to be set.  But since you invoked it then it is occurring on the UI thread.  Because it is on the UI thread and that can only do 1 thing at a time, if ALLflag is false your code will deadlock. 
    The only other code that would set it to true cannot run because it is also invoked on the UI thread and only one of them can run at any one time.  Basically each of your threads are going to try to run on the same thread and only 1 of them will be able
    to.  Until the first thread method finishes the second one will never run.
    If you need Boolean flags then consider using a ManualResetEvent instead.  It is thread safe, works across threads and doesn't have any of the problems of a Boolean field when talking about threading. But you still have a deadlock between your invoked
    code that nothing will solve except rewriting your code.
    Michael Taylor
    http://blogs.msmvps.com/p3net

  • Runtime error R6025 Pure virtual function call....the program shuts down as soon as its opened

    iTunes shuts down as soon as it is opened.  Message says Runtime error R6025.  pure virtual function call.  What is this and can it be fixed???

    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down page in case one of them applies.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    If you've already tried a complete uninstall and reinstall try opening iTunes in safe mode (hold down CTRL+SHIFT) as you start iTunes, then going to Edit > Preferences > Store and turing off Show iTunes in the Cloud purchases. You may find iTunes will now start normally.
    tt2

  • Function calling in thread

    I know that every thread has it own stack which is not shared with the other threads.
    Now for example, I have a program like:
    Whenever a user connects to the server a separate thread is created and receive method is called.
    mythread = new thread(this);
    mythread.start();
    public void run()
    receive(3,4);
    public void receive(int a, int b)
    MyClass my = new MyClass();
    my.add(a,b);
    my.sub(a,b);
    //MyClass is in separate file
    public class MyClass
      public void add(int a, int b)
    a+b;
    public void sub(int a, int b)
    a-b;
    }Now my question is that, weather the functions calling i.e, add(), sub(), in receive() method will be thread safe and will be in the same thread's stack they belong ???
    Edited by: Muhammad Umer on May 3, 2011 12:08 PM

    Here is the actual code:
        public boolean startServer()
          boolean isServerStarted = true;
            try
                welcomeSocket = new ServerSocket(6789);
                //System.out.println("Server is started on : "+welcomeSocket.getInetAddress()+"and on port: "+welcomeSocket.getLocalPort());
            catch (IOException ex)
                    isServerStarted = false;
                    System.out.println("could not start server");
                    ex.getMessage();
          while(true)
                try
                    connectionSocket = welcomeSocket.accept(); // connectionSocket is class variable
                    System.out.println("client connected with address: "+connectionSocket.getRemoteSocketAddress());
    //                serverThread = new Thread(this);
    //                serverThread.start();
                   RequestHandler reqhanlder = new RequestHandler(connectionSocket);
                   reqhanlder.start();
                catch (IOException ex)
                    isServerStarted = false;
                    System.out.println("could not start server");
                    ex.getMessage();
        public void receiveData (Socket connectionSocket)
            byte [] certData = null;
            byte [] idData = new byte[13];
            try
                DataInputStream dataFromClient = new DataInputStream(connectionSocket.getInputStream());
                byte[] data =new byte[dataFromClient.available()];
                int read = dataFromClient.read(data);
                System.out.println("Data length is: "+data.length);
                if( read != -1)
                    certData = new byte[data.length - idData.length];
                    System.out.println("cert length is: "+certData.length);
                    System.arraycopy(data, 0, certData, 0, certData.length);
                    System.arraycopy(data, certData.length, idData, 0, idData.length);
                    try
                        this.userCertificate = CertificateFactory.getInstance("X.509").generateCertificate(new ByteArrayInputStream(certData));
                        System.out.println("User certificate coming from card is: \n"+this.userCertificate);
                        System.out.println( caCertificate.getPublicKey() );
                        if( isOpen )
                            verifyCert = new VerifyCertificate();
                            boolean iVerified = verifyCert.verifyCertificate( userCertificate, caCertificate.getPublicKey() );
                            if( iVerified )
                                System.out.println("Certificate is verified");
                            else if( !iVerified )
                                System.out.println("Certificate is not verified");
                        else if( !isOpen)
                            System.out.println("could not set CA public key");
                    catch (CertificateException ex)
                       System.out.println("could not create the certficate");
                       ex.printStackTrace();
                    System.out.println("Data length is: "+data.length+"\nData received is: ");
                else
                    System.out.println("Could not read data, \nData length is: "+data.length);
            catch (IOException ex)
                System.out.println("could not receive data from client");
               ex.getMessage();
    public class RequestHandler extends Thread
        Socket connectionSocket;
        Server server;
        public RequestHandler(Socket connectionSocket)
            this.connectionSocket = connectionSocket;
        @Override
        public void run()
            server = new Server();
            server.receiveData(connectionSocket);
    }

  • Foreign Function calls on Web

    I have employed foreign function calls to several COM objects (dll's) within my forms application. It works fine as a client /server product but when i attempt to deploy it across the web the forms cannot locate the dll's.
    I have have installed and registered all the dlls on both the webserver machine and the client machine. No information is passed to the FF's - they are doing internal validation of licenses.
    Has anyone else tried something similar or am i chasing ghosts in hoping that i can do this across the web

    Flex Beta 3
    Also, is there a way of debugging or dumping
    objects/variables?? and in CF we can do a <cfdump
    var="#session#" /> or whatever. I figured that is why you asked
    which version of Flex?
    It would be nice to inspect objects and see whats inside. I
    finally got CF and Flex to work together and I can now populate my
    data grids from query objects, but it would be nice to be able to
    say dump the object before I populate my datagrid or whatever just
    to see. I have learned just using <cfdump> in CF.
    -weStSide

Maybe you are looking for

  • Check free goods in inqury (Failed)

    Hi Guru: It seemed that I failed to check the free goods via transaction va11 when creating the inquiry,I have no authorzation to use va01 since I am not CSR person,I just wanne to check the free goods which I had created  before to see if it works n

  • Gets stuck on grey screen with logo after restore.

    I restored my 2008 macbook and reinstalled OS X lion onto it. It downloaded items for lion and automatically restarted. When it restarted it got stuck on a grey screen with the apple logo and a spinning circle. I turned the computer off and attempted

  • How to import contacts from iPhone to Macbook Address Book...?

    Whenever I go under iTunes > Info > Sync Contacts It tries to import my empty contact list ON my mac to my iPhone, rather than import my iPhone contacts onto my Mac. How do I import my contacts into my address book? Please be specific, because from m

  • Help needed for unusual .mpeg playback.....

    Hello out there in discussion world. Thanks for taking the time to read this strange problem I'm having with some .mpeg and .mpg files playing back funny. Here's the scenario. 4 years ago, I was big into downloading music videos and live shows off ka

  • Self assigned IP address bull

    Ok, I suffer from the self assigned ip nightmare that so many face! But still there is no word from your official site on how to fix this! I gave up using my PC that was assigned to me at my work place. I brought my mac and since then it has been not