Reading HashMap Values From a File

Hi,
I haven't done file I/O in quite a while, so I'm a little rusty.
I have a HashMap<TreePath, Entity> that I need to store persistently. Thus far I have been creating a new HashMap every time a new session starts and populating it with Entity objects that I create from JDBC ResultSets. The TreePath is generated by adding each Entity object to its parent in the JTree. That all works well.
Now I'm trying to write the HashMap to file using ObjectOutputStream. Basically I want to be able to load the JTree (which does not need to be persistent at this stage), and as I load it I get the TreePath of each TreeNode. If that TreePath is a key in the persistent HashMap, then I want to display the details stored in the corresponding Entity. However, when I try to read the HashMap using an ObjectInputStream, I get a NullPointer.
I'm not sure whether the problem is in the way I'm trying to write or read the HashMap, or both. I've followed the examples in the API but they don't seem to be doing the job.
Any suggestions?

I have isolated the problem.
HashMap<TreePath, Entity> map = memory.getMap();
TreePath nodePath = new TreePath(node.getPath()); //where node is a DefaultMutableTreeNode
System.out.println("1. Desired key is: " + nodePath);
System.out.println("2. Map contains key: " + map.containsKey(nodePath));
System.out.println("3. Keys in map: " + map.keySet().toString());When I use a volatile Java object to store the map, an example of the output produced by the following code is:
1. Desired key is: [DW, Acct]
2. Map contains key: true
3. Keys in map: [[DW], [DW, Acct]]
However, when I use file I/O to make the Java object permanent, an example of the output produced by the following code is:
1. Desired key is: [DW, Acct]
2. Map contains key: false
3. Keys in map: [[DW], [DW, Acct]]
As far as I can see, line 2 of the I/O output should be true, not false, since line 3 shows that the key is present in the map.
Am I missing something here, or is the containsKey() method returning the incorrect result? It looks like it is getting its reference to map all wrong.

Similar Messages

  • Reading Design values from readback file

    Hi All,
    I am trying to understand the process of reading back design signal values from readback file.
    I have both the .ll file and the readback.bin file
    To get the readback file, I executed the below command:
    % readback_hw_device [current_hw_device] -readback_file <filename.rbd> -bin_file <filename.bin>
    Now, I want to know the command or process to read the design signal values from this .bin file? Is there any command provided by Xilinx or anything else that I can do to read the signal values?
    Rgds
    Sapan
     

    
    Hi Syed,
    Thanks for the reply. It was actually my own started thread. I had few questions unanswered from that post:
    Question:
    The procedure for readback that I am following here is based on the ug908-vivado programming and debugging.  
    I first uploaded the image on FPGA and then I executed the following commands in Vivado Hardware Manager
    % create_hw_bitstream -hw_device [current_hw_device] -mask fpga.msk fpga.bit
    % verify_hw_devices [current_hw_device]   #### For readback verify
    readback_hw_device [current_hw_device] -readback_file <filename.rbd> -bin_file <filename.bin> #####for readback capture
    This looks a little different from the one suggested in your document. Can you please confirm if my steps are correct?
    Using the above procedure, I did not have to explicitly send readback commands to the FPGA using JTAG as mentioned in doc:
    http://www.xilinx.com/support/documentation/sw_manuals/xilinx2015_1/ug908-vivado-programming-debugging.pdf
    However the other doc http://www.xilinx.com/support/documentation/application_notes/xapp1230-configuration-readback-capture.pdf mentions sending commands to the device in order to be able to do a readback.
    So I am a little confused which one is correct?
    Also which document will give the words per frame information for  FPGA XC7VX485TFFG1761?
    Rgds
    Sapan
     

  • Read Specific value/Search Into file

    Hi i need a java code which read specific value from a file.
    Example:
    I have a text file named data.txt
    it contain :
    Customer Name :Sarwar
    Customer Id : 001
    Product Price :2000
    now how can i take values 001 and 2000 from the file data.txt and save them in a another text file named new_data.txt ?
    Can any one help me?

    Search Google for 'java file read'. Wanna write to a file? Search for 'java file write'. Ain't Google awesome?
    If you haven't already done so, I suggest you search www.amazon.com for a beginner book on Java that has good reviews. Its much more efficient to read a book on Java than spend countless hours trying to learn it through code examples found on the internet.

  • Read bool value from xml

    Hi all :
    I try to read Boolean value from xml file , please see attach file , all the time this error rise
    I know that The XML tag describing the type of data does not match, how can I get Boolean value " 1" or "0 "
    Thanks
    wisam
    Attachments:
    untitled1.JPG ‏115 KB

    You are not trying to read boolean.. you are trying to read a DBL.
    To read a DBL you must first write a DBL to XML.
    To read a boolean replace the DBL with a boolean

  • I am facing problem while reading values from properties file ...i am getting null pointer exception earlier i was using jdeveloper10g now i am using 11g

    i am facing problem while reading values from properties file ...i am getting null pointer exception earlier i was using jdeveloper10g now i am using 11g

    hi TimoHahn,
    i am getting following exception in JDeveloper(11g release 2) Studio Edition Version 11.1.2.4.0 but it works perfectly fine in JDeveloper 10.1.2.1.0
    Root cause of ServletException.
    java.lang.NullPointerException
    at java.util.PropertyResourceBundle.handleGetObject(PropertyResourceBundle.java:136)
    at java.util.ResourceBundle.getObject(ResourceBundle.java:368)
    at java.util.ResourceBundle.getString(ResourceBundle.java:334)
    at org.rbi.cefa.master.actionclass.UserAction.execute(UserAction.java:163)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

  • Read value from text file to JTextField

    Hi,
    I think this is the right place to post this. Although maybe it is not it could be classed as I/O issues?
    I have a JFrame with a JTextField which requires the user to enter a value. When they click a JButton "OK". It writes the value to a text file and closes the frame using FileWriter. If they click clear button it writes the value "" to the file. What I want to do is when the frame opens it reads the value from the text file. I have been trying to use FileReader but have not been able to write the code correctly. Any help would be greatly appreciated.
    Thanks

    File f = yourfile;
    BufferedReader br = new BufferedReader(new FileReader(f));
    String value = br.readLine();Alex.

  • Reading each value from spreadshee​t file with delay (multiple rows and columns)

    Hi,
    a) I want to read EACH VALUE from a spreadsheet file having multiple rows and columns WITH DELAY. I am attaching my VI and sample datalog file for reference (tempsensor.txt).I need to do so because as soon as I read put ON the Sensor button on front panel, LV reads all the values at one go. I need the values for each temperature to be displayed after a delay.
    b) Secondly, I would like to read another file containing the state of four antennas (deployed:1; undeployed:0). I am logging state of each antenna in each column of the file(magnet.txt) I need to have four LEDS on front panel to display state of the antennas. I dont know what I have done for antennas in my VI is right or wrong. I guess thats rhe wrong way to approach the problem. Please help!!!(column1: Antenna1 state ; Column2:Antenna2 state.. and so..on..)
    Any help would be greatly appreciated!!
    Thanks in advance,
    Ratnesh
    FYI: The first column in my datalog file represents timestamp(number of seconds elapsed), second column: reading for temperature sensor 1, third column: reading for temperature senosr 2, and so on. I am using approx. 11 temperature sensors.
    Also, I have generated the log files for the reference purpose only. They do not represent the actual values. They are far away from actual values.
    Attachments:
    01032005.zip ‏30 KB

    Look at this modified version of your VI. After looking at it, I determined that a shift reggister was not required in this case.
    Lynn
    Attachments:
    MultiSensors.2.vi ‏85 KB

  • READING AND WRITING FROM A FILE(WRITTEN IN ANOTHER LANGUAGE)

    # Comment
    INTEGER Declares integer type variable
    STRING Declares string type variable
    LET Assigns a variable
    CALCULATE Performs an arithmetic calculation
    PRINT Writes data to the console
    PRINTLN As print, but followed by a new line
    END Terminates the program
    Each line of the program must begin with one of these words, and the language should not be case sensitive.
    Tim Brailsford, 2007
    G64ICP
    COMMENT
    Any line beginning with the # character is completely ignored.
    Example:
    # ignore this line!
    INTEGER
    The INTEGER reserved word declares an Integer variable, and assigns a default value of 0 to it.
    Example:
    INTEGER myInt
    This example is equivalent to the Java statment "int myInt=0;"
    STRING
    The STRING reserved word declares a String variable, and assigns an empty string to it.
    Example:
    STRING myString
    This is equivalent to the Java statement "String myString;"
    LET
    This assigns values to variables (either integers, or strings enclosed
    in double quotes).
    Examples:
    LET myInt=42
    LET myString="Hello World!"
    CALCULATE
    This performs numeric calculations upon values or variables, and assigns the result to a variable (which must have
    been declared earlier). Four operators are supported: + *
    and / (for addition, subtraction multiplication and
    integer division respectively).
    Examples:
    CALCULATE myInt=2*2
    CALCULATE myInt=myInt+24
    CALCULATE myInt=intA/intB
    PRINT and PRINTLN
    These words both print to the console the
    only difference being that PRINTLN appends a new line (as does
    System.out.println in Java). These can print either text provided as an argument, or variables (string or integer).
    Examples:
    PRINTLN "Hello World!"
    PRINT myString
    PRINTLN myInt
    END
    This terminates the program, and prints a message to that effect.
    TPL Example
    To the left is an example TPL input file , to
    calculate the factorial of 5. This should produce
    an output similar to that shown overleaf (except
    that calculates the factorial of 10).
    # A TPL Program to calculate the factorial of 5
    INTEGER myInt
    INTEGER factorial
    STRING myString
    LET mystring="Factorial Program"
    LET myInt=5
    CALCULATE factorial=myInt*4
    CALCULATE factorial=factorial*3
    CALCULATE factorial=factorial*2
    Tim Brailsford, 2007
    G64ICP
    PRINTLN mystring
    PRINTLN
    PRINT "The factorial of "
    PRINT myInt
    PRINT " is "
    PRINTLN factorial
    END
    Documentation
    Document your code by writing instructions explaining how to run it, listing all of the files you have submitted,
    and specifying any limitations (eg you might want to say what platforms you would expect it to run on, and what
    platforms you have tested it on). This document should be written as a plain text file (ie ASCII � MS Word binary
    files are not acceptable) � and this file should be called README.TXT. This file should constitute the user
    manual of your program, and should explain exactly how to use your program.
    The README file should be the user manual for your language as implemented.
    NB:
    I want it to read values from the file as given above and execute the answer in the command prompt( as intented in the file above)
    Thanks
    Alam Ikenna

    Hai I have one doubt in doing other peoples homework for them. Why bother?

  • How can I input read a line from a file and output it into the screen?

    How can I input read a line from a file and output it into the screen?
    If I have a file contains html code and I only want the URL, for example, www24.brinkster.com how can I read that into the buffer and write the output into the screen that using Java?
    Any help will be appreciate!
    ======START FILE default.html ========
    <html>
    <body>
    <br><br>
    <center>
    <font size=4 face=arial color=#336699>
    <b>Welcome to a DerekTran's Website!</b><br>
    Underconstructions.... <br>
    </font> </center>
    <font size=3 face=arial color=black> <br>
    Hello,<br>
    <br>
    I've been using the PWS to run the website on NT workstation 4.0. It was working
    fine. <br>
    The URL should be as below: <br>
    http://127.0.0.1/index.htm or http://localhost/index.htm
    <p>And suddently, it stops working, it can't find the connection. I tried to figure
    out what's going on, but still <font color="#FF0000">NO CLUES</font>. Does anyone
    know what's going on? Please see the link for more.... I believe that I setup
    everything correctly and the bugs still flying in the server.... <br>
    Thank you for your help.</P>
    </font>
    <p><font size=3 face=arial color=black>PeerWebServer.doc
    <br>
    <p><font size=3 face=arial color=black>CannotFindServer.doc
    <br>
    <p><font size=3 face=arial color=black>HOSTS file is not found
    <br>
    <p><font size=3 face=arial color=black>LMHOSTS file
    <br>
    <p><font size=3 face=arial color=black>How to Setup PWS on NT
    <BR>
    <p><font size=3 face=arial color=black>Issdmin doc</BR>
    Please be patient while the document is download....</font>
    <font size=3 face=arial color=black><br>If you have any ideas please drop me a
    few words at [email protected] </font><br>
    <br>
    <br>
    </p>
    <p><!--#include file="Hits.asp"--> </p>
    </body>
    </html>
    ========= END OF FILE ===============

    Hi!
    This is a possible solution to your problem.
    import java.io.*;
    class AddressExtractor {
         public static void main(String args[]) throws IOException{
              //retrieve the commandline parameters
              String fileName = "default.html";
              if (args.length != 0)      fileName =args[0];
               else {
                   System.out.println("Usage : java AddressExtractor <htmlfile>");
                   System.exit(0);
              BufferedReader in = new BufferedReader(new FileReader(new File(fileName)));
              StreamTokenizer st = new StreamTokenizer(in);
              st.lowerCaseMode(true);
              st.wordChars('/','/'); //include '/' chars as part of token
              st.wordChars(':',':'); //include ':' chars as part of token
              st.quoteChar('\"'); //set the " quote char
              int i;
              while (st.ttype != StreamTokenizer.TT_EOF) {
                   i = st.nextToken();
                   if (st.ttype == StreamTokenizer.TT_WORD) {          
                        if (st.sval.equals("href")) {               
                             i = st.nextToken(); //the next token (assumed) is the  '=' sign
                             i = st.nextToken(); //then after it is the href value.               
                             getURL(st.sval); //retrieve address
              in.close();
         static void getURL(String s) {     
              //Check string if it has http:// and truncate if it does
              if (s.indexOf("http://") >  -1) {
                   s = s.substring(s.indexOf("http://") + 7, s.length());
              //check if not mailto: do not print otherwise
              if (s.indexOf("mailto:") != -1) return;
              //printout anything after http:// and the next '/'
              //if no '/' then print all
                   if (s.indexOf('/') > -1) {
                        System.out.println(s.substring(0, s.indexOf('/')));
                   } else System.out.println(s);
    }Hope this helps. I used static methods instead of encapsulating everyting into a class.

  • Reading long text from excel file to an internal table

    Hi
    Can any body tell me how to read long text from excel file to an internal table.
    When i am using this FM KCD_EXCEL_OLE_TO_INT_CONVERT then it is reading only 32 characters from each cell.
    But in my excel sheet in one of the cell has very long text which i need to upload into a internal table.
    may i know which FM or what logic i need to use for this problem.
    Regards

    Hi,
    Here is an example program.  It will upload an Excel file with two columns.  You could also assign the Excel structure dynamically, but I wanted to keep the example simple.  The main point is that the internal table (it_excel in this example) must match the Excel structure that you want to convert.
    Remember, this is just an example to help you figure out how to properly use the technique.  It will certainly need to be modified to fit your requirements, and as always there may be a better way to get the Excel converted... this is just one possibility that has worked for me in the past.
    *& Report  zexcel_upload_test                            *
    REPORT  zexcel_upload_test.
    TYPE-POOLS: truxs.
    TYPES: BEGIN OF ty_excel,
             col_a(10) TYPE n,
             col_b(35) TYPE c,
           END OF ty_excel.
    DATA: l_data_tab         TYPE TABLE OF string,
          l_text_data        TYPE truxs_t_text_data,
          l_gui_filename     TYPE string,
          it_excel           TYPE TABLE OF ty_excel.
    FIELD-SYMBOLS: <wa_excel>  TYPE ty_excel.
    PARAMETERS: p_file TYPE rlgrap-filename.
    * Pass the file name in the correct format
    l_gui_filename = p_file.
    * Upload data from PC
    CALL METHOD cl_gui_frontend_services=>gui_upload
      EXPORTING
        filename                = l_gui_filename
        filetype                = 'ASC'
        has_field_separator     = 'X'
      CHANGING
        data_tab                = l_data_tab
      EXCEPTIONS
        file_open_error         = 1
        file_read_error         = 2
        no_batch                = 3
        gui_refuse_filetransfer = 4
        invalid_type            = 5
        no_authority            = 6
        unknown_error           = 7
        bad_data_format         = 8
        header_not_allowed      = 9
        separator_not_allowed   = 10
        header_too_long         = 11
        unknown_dp_error        = 12
        access_denied           = 13
        dp_out_of_memory        = 14
        disk_full               = 15
        dp_timeout              = 16
        OTHERS                  = 17.
    IF sy-subrc <> 0.
    *   MESSAGE ...
      EXIT.
    ENDIF.
    * Convert from Excel into the appropriate itab
    l_text_data[] = l_data_tab[].
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
      EXPORTING
        i_field_seperator    = 'X'
        i_tab_raw_data       = l_text_data
        i_filename           = p_file
      TABLES
        i_tab_converted_data = it_excel
      EXCEPTIONS
        conversion_failed    = 1
        OTHERS               = 2.
    IF sy-subrc <> 0.
    *   MESSAGE ...
      EXIT.
    ENDIF.
    LOOP AT it_excel ASSIGNING <wa_excel>.
    *  Do something here...
    ENDLOOP.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      PERFORM filename_get CHANGING p_file.
    *       FORM filename_get                                             *
    FORM filename_get CHANGING p_in_file TYPE rlgrap-filename.
      DATA: l_in_file  TYPE string,
            l_filetab  TYPE filetable,
            wa_filetab TYPE LINE OF filetable,
            l_rc       TYPE i,
            l_action   TYPE i,
            l_init_dir TYPE string.
    * Set the initial directory to whatever you want it to be
      l_init_dir = 'C:\'.
    * Call the file open dialog without multiselect
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title            = 'Load file'
          default_extension       = '.XLS'
          default_filename        = l_in_file
          initial_directory       = l_init_dir
          multiselection          = 'X'
        CHANGING
          file_table              = l_filetab
          rc                      = l_rc
          user_action             = l_action
        EXCEPTIONS
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_gui            = 3
          OTHERS                  = 4.
      IF sy-subrc <> 0.
        REFRESH l_filetab.
      ENDIF.
    * Read the selected filename
      READ TABLE l_filetab INTO wa_filetab INDEX 1.
      IF sy-subrc = 0.
        p_in_file = wa_filetab-filename.
      ENDIF.
    ENDFORM.                    " filename_get
    Regards,
    Jamie

  • Passing Value from one File to Another !!!

    Hi Friends,
    I have an issue, I have two different Swing programs (two seperate java files). I want to transfer value from one file to the another. Like we do in Servlets or JSP, we use sessions or Hiddenfields. The same way I want to retriev value in a new file from a previous one.
    Hope that all u champs out there have the answer to my query.
    Thanks,
    [email protected]

    This is a B2B comms question...
    A quick and dirty method is to use Socket/ServerSocket and use a basic protocol to do the transfer, if you are feeling heroic then use XML as the message format...
    A lot depends on whether your applications are running on separate boxes, i.e. do you need to communicate across a network...
    If not, if they are always going to be on the same "box" then you could just use well-known places for files...not portable but effective...

  • Passing The Value from csv file to a WebApplication

    Hi to all,
    i have a csv file. my requirement is to transfer data from csv file to a specified website(i have no control over website.). How can i solve this problem?
    I am giving you an Example for better understanding:
    I have a csv file named "abc.csv" in which my login id and password of my mail is written.
    abc.csv:----
    Userid:Admin
    Password:Admin
    Now i want a program which will take these values and pass these values to my mail server so that i can login without entering manualy.
    How can i solve this Problem
    Thanks

    hi
    what You are telling is correct when we our form is in the same application. but i said that i have only csv file and my program to read that file and now with those values from csv fil ei have to lo in a diffrent site over which i don,t have any control. means i can not know the name of action class of that login page.

  • RE: (forte-users) Reading return value from Javaprogram

    when using the RunCommand method you can specify the an error file:
    task.part.os.RunCommand(command = l_tdCommandLine,
    isSynchronous = TRUE,
    inputFile = Nil,
    outputFile = Nil,
    errorFile = l_ErrorFile.GetLocalName(TRUE));
    BEGIN
    l_ErrorFile.Open(SP_AM_READ);
    EXCEPTION
    WHEN Ex: FileResourceException DO
    l_ErrorFile = NIL;
    task.ErrorMgr.Clear();
    END;
    IF l_ErrorFile <> NIL THEN
    l_tdFileContents : TextData = New();
    l_ErrorFile.ReadText(l_tdFileContents);
    l_ErrorFile.Close();
    END IF;
    Have you java program output the return value to the standard IO. This way
    you will have an error file that you can read from Forte.
    ka
    -----Original Message-----
    From: Anthony D [mailto:saigonxyahoo.com]
    Sent: Tuesday, September 12, 2000 7:49 AM
    To: forte-userslists.xpedior.com
    Subject: (forte-users) Reading return value from Java program
    Hi,
    Does anyone know whether Forte application can
    read a return value from a Java program?
    I'm using the RunCmd method to invoke the Java
    program. I'd like to read the return value from the
    Java program. How do I go about doing it?
    Any suggestion will be appriciated.
    Thanks
    AD
    http://mail.yahoo.com/
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

    when using the RunCommand method you can specify the an error file:
    task.part.os.RunCommand(command = l_tdCommandLine,
    isSynchronous = TRUE,
    inputFile = Nil,
    outputFile = Nil,
    errorFile = l_ErrorFile.GetLocalName(TRUE));
    BEGIN
    l_ErrorFile.Open(SP_AM_READ);
    EXCEPTION
    WHEN Ex: FileResourceException DO
    l_ErrorFile = NIL;
    task.ErrorMgr.Clear();
    END;
    IF l_ErrorFile <> NIL THEN
    l_tdFileContents : TextData = New();
    l_ErrorFile.ReadText(l_tdFileContents);
    l_ErrorFile.Close();
    END IF;
    Have you java program output the return value to the standard IO. This way
    you will have an error file that you can read from Forte.
    ka
    -----Original Message-----
    From: Anthony D [mailto:saigonxyahoo.com]
    Sent: Tuesday, September 12, 2000 7:49 AM
    To: forte-userslists.xpedior.com
    Subject: (forte-users) Reading return value from Java program
    Hi,
    Does anyone know whether Forte application can
    read a return value from a Java program?
    I'm using the RunCmd method to invoke the Java
    program. I'd like to read the return value from the
    Java program. How do I go about doing it?
    Any suggestion will be appriciated.
    Thanks
    AD
    http://mail.yahoo.com/
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

  • Read IP address from iak file

    Hello,
    I have several cfp-1804 modules connected and functioning properly.  I would like to programatically read the IP address for each module from the *.iak file or maybe from MAX.  I want to be able to determine the IP address within my LabVIEW program even if the modules are disconnected or powered off.
    Thanks.  Corey

    I am using the LabVIEW project and after looking at the .aliases file I see the IP address.  I think that will work for me.  Thanks.
    The modules frequently get disconnected from the network or power is removed.  I want the IP address so I can Ping the modules to determine if they are connected.  I didn't want to hard code in the IP address, so that is why I wanted to pragmatically read it.  Currently, I try to read a value from the cfp-1804 to determine connection status.  This works, but it takes a long time (up to 30 seconds) if the unit is disconnected.  I also have experienced an issue where I can disconnect the network cable, but am still able to get a reading from the cfp module.  I've read that this is possible because the data is cached locally.

  • Problem reading RFC values from IRecordSet !!!!

    Hi All,
    I am having some problem reading values from IRecordSet. Can not seem to parse the output structure from RFC. AM using connector gateway service to execute BAPI_EXCHRATE_GETCURRENTRATES.
    Here is the code,
    MappedRecord input = rf.createMappedRecord("input");
    input.put("DATE",new String("01011990"));
    input.put("DATE_TYPE", new String("V"));
    input.put("RATE_TYPE", new String("M"));
    MappedRecord output = (MappedRecord) ix.execute(ixspec, input);
    Object rs = null;
    IRecordSet recSet = null;
    Object result = output.get("EXCH_RATE_LIST");
    if (result == null) {
    response.write("<BR>null");
    rs = new String(" ");
    } else if (result instanceof IRecordSet) {
    IRecordSet irs = (IRecordSet) result;
    response.write("<BR>Got some dataaa");
    IRecordMetaData rsmd = null;
    rsmd = irs.retrieveMetaData();
    irs.beforeFirst();
    while(irs.next()){
    response.write("Row::"+irs.getString("RATE_TYPE")+" "+irs.getString("FROM_CURR")+" "+irs.getString("EXCH_RATE"));
    Am getting the pritn statement, Got Some Data on the PDK component.
    But somehow not able to read the values from IRecordSet
    What is the mistake here?
    Pls help
    Edited by: Aakash Jain on Oct 11, 2008 12:22 AM

    Hi
    Try in this way.
    IRecordSet resultTable = (IRecordSet)outputParams.get("TABLE_NAME");
    for(resultTable.beforeFirst(); resultTable.next(); ) {
    response.write(resultTable.getString(0));
    response.write(resultTable.getString(1));
    Thanks

Maybe you are looking for