Loading all records question

Hi,
I managed to save to a file but when I try to retrieve all records it only lists one of them . What am I doing wrong?
The whole code is at:
http://www.multiline.com.au/~wje/java/question.html
Thanks for your help.
Andonny
to load:
  public void load(String filename)
         try {
                Map map = new HashMap();
                  Reference1 item;
                  items = new Vector();
               DataInputStream inStream = new DataInputStream(new FileInputStream(filename));
                String code = inStream.readUTF();
                double pr = inStream.readDouble();
                System.out.println(pr);
                int qty = inStream.readInt();
                String auth = inStream.readUTF();
                String pub = inStream.readUTF();
                int yr = inStream.readInt();
                String cat = inStream.readUTF();
                String ref = inStream.readUTF();
               item = (Reference1)map.get(code);
             if (item == null)
                         item = new Reference1(code,pr,qty,auth,pub,yr,cat,ref);
                         items.addElement(item);               
               map.put(code, item);
    catch (Exception e) {
      e.printStackTrace();
      System.exit(1);
  }to save:
   public void save(String filename) {
    try {
      DataOutputStream outStream = new DataOutputStream(new FileOutputStream(filename));
       Iterator iterItems = items.iterator();
      while (iterItems.hasNext()) {
          Reference1 s = (Reference1) iterItems.next();    
           outStream.writeUTF(s.getProductCode());
           outStream.writeDouble(s.getPrice());
           outStream.writeInt(s.getQuantity());
           outStream.writeUTF(s.getAuthor());
           outStream.writeUTF(s.getPublisher());
           outStream.writeInt(s.getYear());
           outStream.writeUTF(s.getCategory());
           outStream.writeUTF(s.getReference()); 
      } // end while
      outStream.close();
    catch (Exception e) {
      e.printStackTrace();
  }

Hi,
Thank you for your advice.
I did insert a for loop and it loads all the items. In this case I know that I have 4 items in the file so it is okay to loop to 4. How can I loop to the last record not knowing how many are there. What do I need to put as the 4 to make it universal.
public void load(String filename)
         try {
                Map map = new HashMap();
                  Reference1 item;
               DataInputStream inStream = new DataInputStream(new FileInputStream(filename));
               for(int i = 0; i < 4; i++){
                     String code = inStream.readUTF();
                     double pr = inStream.readDouble();
                     int qty = inStream.readInt();
                     String auth = inStream.readUTF();
                     String pub = inStream.readUTF();
                     int yr = inStream.readInt();
                     String cat = inStream.readUTF();
                     String ref = inStream.readUTF();
                    item = (Reference1)map.get(code);
                  if (item == null) {
                         item = new Reference1(code,pr,qty,auth,pub,yr,cat,ref);
                         items.addElement(item);               
               map.put(code, item);
    catch (Exception e) {
      e.printStackTrace();
      System.exit(1);
  }

Similar Messages

  • Sql loader - skip record question

    I am running Oracle 9 and using sql loader to import text file into table. Can sql loader skips the record which contain blank line or carriage return? Do I need to set up with options? Please advise me how. Thanks.

    http://docs.oracle.com/cd/B10500_01/server.920/a96652/ch05.htm
    http://www.orafaq.com/wiki/SQL*Loader_FAQ

  • Data loads is not picking up all records

    Hello, wonder if anyone ever encountered the following problem.  I've been trying to load a flat file to BPC and for a year now, we've had no issues.  This time however, it seems that not all records were loaded, eventhough the status indicated the correct number of rows were successfully loaded.  Any ideas what may be causing this?  I've checked the conversion files, account dimension and nothing has changed.  Any help with this is greatly appreciated.  Ideas on how / where to check for potential trouble spots are all welcome.
    Thanks in advance.
    David

    Hello,
        If you are using the standard SSIS package import, the rejected record should be reported into the log file at the end. However, in order to see if there are rejected records or not, you can try to validate your transformation file using the same import file.
    You can also verify also the temporary files generated into D:\BPC\Data\Webfolders\APSHELL_Sorin\Finance\PrivatePublications. In this way you can find the right calues imported into the cube.
        How you check if data is loaded or not?
    Best regards,
    Mihaela

  • Application view loading all the records on view

    Hello,
    We have a customization navigating from JTT pages to opening a OA Frame work page, occassionally user reporting the target "OA Framework page" hungs, and poor response from application. We noticed in EBS -> Poolmonitor VO is trying to load all the records from the table, unable to reproduce this scenario.
    Why application loosing request parameters?
    Any help is appreciated, thanks in advance.
    Pullarao.

    Hello,
    We have a customization navigating from JTT pages to opening a OA Frame work page, occassionally user reporting the target "OA Framework page" hungs, and poor response from application. We noticed in EBS -> Poolmonitor VO is trying to load all the records from the table, unable to reproduce this scenario.
    Why application loosing request parameters?
    Any help is appreciated, thanks in advance.
    Pullarao.

  • When starting iTunes get the following message " Apple Application Support is required" uninstall and re-install iTunes. Question will I lose all records currently in iTunes ??  H=

    Get a message on Itunes to uninstall and re-install Itunes since " Apple Application Support is required" Will this cause me to lose all records? Is there some to avoid this have tried to repair No LUCK

    Let's try a standalone Apple Application Support install. It still might not install, but fingers crossed any error messages will give us a better idea of the underlying cause of the issue.
    Download and save a copy of the iTunesSetup.exe (or iTunes64setup.exe) installer file to your hard drive:
    http://www.apple.com/itunes/download/
    Download and install the free trial version of WinRAR:
    http://www.rarlab.com/
    Right-click the iTunesSetup.exe (or iTunes64Setup.exe), and select "Extract to iTunesSetup" (or "Extract to iTunes64Setup"). WinRAR will expand the contents of the file into a folder called "iTunesSetup" (or "iTunes64Setup").
    Go into the folder and doubleclick the AppleApplicationSupport.msi to do a standalone AAS install.
    Does it install properly for you? If so, does iTunes launch properly now?
    If instead you get an error message during the install, let us know what it says. (Precise text, please.)

  • Incomplete Data on report (report does not show all records from the table)

    Hello,
    I have problem with CR XI, I'm running the same report on the same data with simple select all records from the table (no sorting, no grouping, no filters)
    Sometimes report shows me all records sometimes not. Mostly not all records on the report. When report incomplete sometimes it shows different number of records.
    I'm using CR XI runtime on Windows Server 2003
    Any help appreciated
    Thanks!

    Sorry Alexander. I missed the last line where you clearly say it is runtime.
    A few more questions:
    - Which CR SDK are you using? The Report Designer Component or the CR assemblies for .NET?
    - What is the exact version of CR you are using (from help | about)
    - What CR Service Pack are you on?
    And a troubleshooting suggestion:
    Since this works on some machines, it will be a good idea to compare all the runtime (both CR and non CR) being loaded on a working and non working machines.
    Download the modules utility from here:
    https://smpdl.sap-ag.de/~sapidp/012002523100006252802008E/modules.zip
    and follow the steps as described in this thread:
    https://forums.sdn.sap.com/click.jspa?searchID=18424085&messageID=6186767
    The download also includes instructions on how to use modules.
    Ludek

  • Load multiple records in 1 table from 1 line in text file w/sql loader

    hi guys,
    quick question, perhaps someone can help. searched around and didn't see this question asked before, and can't find any answer in SQL Loader faqs or docs.
    i know i can extract multiple logical records from a single physical record in the input file as two logical records, and then use two into tables clauses to load the data into the table. see oracle 9i sql loader control file reference chapter 5 to see what i am talking about.
    but my question follows:
    cust_id amount1_val amount1_qual amount2_val amount2_qual amount3_val amount3_qual
    123 1500.35 TA 230.34 VZ 3045.50 TW
    basically i want to use one sql loader statement to load these 3 records into 1 table. the issue for me is that i need to re-use the cust_id for all 3 records as the key, along with the qualifier code. the example in the Oracle docs only works for data where the logical records are completely separate -- no shared column values.
    i'm sure this is possible, perhaps using some :cust_id type parameter for the 2nd and 3rd records, or something, but i just don't have enough knowledge/experience with sql loader to know what to do. appreciate any help.
    wayne

    Hi wayne,
    I found an example on what exactly you were looking for from an SQL*Loader documentation. Please see if it of some help to you
    EXAMPLE
    The control file is ULCASE5.CTL.
    1234 BAKER 10 9999 101
    1234 JOKER 10 9999 777
    2664 YOUNG 20 2893 425
    5321 OTOOLE 10 9999 321
    2134 FARMER 20 4555 236
    2414 LITTLE 20 5634 236
    6542 LEE 10 4532 102
    2849 EDDS xx 4555
    4532 PERKINS 10 9999 40
    1244 HUNT 11 3452 665
    123 DOOLITTLE 12 9940
    1453 MACDONALD 25 5532
    In the above datafile
    Column1 - Empno
    Column2 - ENAME
    Column3 - Depno.
    Column4 - MGR
    Column5 - Proj no.
    -- Loads EMP records from first 23 characters
    -- Creates and loads PROJ records for each PROJNO listed
    -- for each employee
    LOAD DATA
    INFILE 'ulcase5.dat'
    BADFILE 'ulcase5.bad'
    DISCARDFILE 'ulcase5.dsc'
    1) REPLACE
    2) INTO TABLE emp
    (empno POSITION(1:4) INTEGER EXTERNAL,
    ename POSITION(6:15) CHAR,
    deptno POSITION(17:18) CHAR,
    mgr POSITION(20:23) INTEGER EXTERNAL)
    2) INTO TABLE proj
    (empno POSITION(1:4) INTEGER EXTERNAL,
    3) projno POSITION(25:27) INTEGER EXTERNAL) -- 1st proj
    Notes:
    REPLACE specifies that if there is data in the tables to be loaded (EMP and PROJ), SQL*loader should delete the data before loading new rows.
    Multiple INTO clauses load two tables, EMP and PROJ. The same set of records is processed three times, using different combinations of columns each time to load table PROJ.
    Regards,
    Murali Mohan

  • To load special records from worksheet in main memory: C#

    Hello
    I used this code. I do not have any error. My program is run after 55 seconds. My data is large.
    Now all recirds load in RAM. How can I load special records in RAM. For example I want to load record 2 from Book1.xlsx in RAM.
    Microsoft.Office.Interop.Excel.Application app_main = new Microsoft.Office.Interop.Excel.Application();
    Microsoft.Office.Interop.Excel.Workbooks workbooks_main = app_main.Workbooks;
    Microsoft.Office.Interop.Excel.Workbook workbook_main = workbooks_main.Open(Application.StartupPath + @"\Book1.xlsx");
    Microsoft.Office.Interop.Excel.Worksheet worksheet_main = workbook_main.Worksheets[1];
    var cellValue_main = (worksheet_main.Cells[2, 1] as Excel.Range).Value;
    workbook_main.Close();
    workbooks_main.Close();
    System.Runtime.InteropServices.Marshal.ReleaseComObject(workbook_main);
    System.Runtime.InteropServices.Marshal.ReleaseComObject(workbooks_main);
    app_main.Quit();
    System.Runtime.InteropServices.Marshal.ReleaseComObject(app_main);

    Hi ARZARE,
    I have made a test with your code and the value of “cellValue_main”, and I modified your code as below:
    Microsoft.Office.Interop.Excel.Application app_main = new Microsoft.Office.Interop.Excel.Application();
    Microsoft.Office.Interop.Excel.Workbooks workbooks_main = app_main.Workbooks;
    Microsoft.Office.Interop.Excel.Workbook workbook_main = workbooks_main.Open(@"D:\Backup\Desktop\Test.xlsx");
    Microsoft.Office.Interop.Excel.Worksheet worksheet_main = workbook_main.Worksheets[1];
    var cellValue_main = (worksheet_main.Cells[2, 1] as Microsoft.Office.Interop.Excel.Range).Value;
    var rowValue_main = (worksheet_main.Rows[1] as Microsoft.Office.Interop.Excel.Range).Value2; //row value
    workbook_main.Close();
    workbooks_main.Close();
    System.Runtime.InteropServices.Marshal.ReleaseComObject(workbook_main);
    System.Runtime.InteropServices.Marshal.ReleaseComObject(workbooks_main);
    app_main.Quit();
    System.Runtime.InteropServices.Marshal.ReleaseComObject(app_main);
    If you want to get the value of row 2, you could store the “rowValue_main” and query from it. Also, you could loop the cell value of the row to get all the data of the row.
    In addition, if you want to query data from the sheet, I think you could do as the reply from Joel. You could store the data to a dataset or datatable, and query from it.
    If you have any further questions, please feel free to post in this forum.
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a
    href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

  • End routine not updating all records

    Hi,
    I have an end routine to update a cube from another cube.
    The routine has two loops, one child loop inside the main loop. Result Package was sorted before the loops.
    Now, not all records were updated in the target infocube as per expectation. Also, when I pick one such record (that did not get updated) and debug, interestingly it shows that expected value has been assigned to the relevant field. And if I upload only that specific record to the cube, the record does get updated with expected value.
    The problem seem to appear only when the whole set of data is loaded.
    Any suggestion about the coding or further debugging will be greatly appreciated.
    Thanks,
    Pranab

    HI,
    check if u r using any internal tables, make this itab refresh at correct point.i tmight be sumtimes create problem.
    else paste ur code here...
    thnks.

  • Delta package not fetching all records from Delta queue in r/3

    Hello,
    I have loaded Goods Movement Data using 2LIS_03_BF datasource into my BI system.
    The Delta has been initialized and everyday the delta is being moved from r/3.
    I observed that when I execute my delta package not all delta records are fetched into PSA from r/3.
    For Ex: Before starting my delta package I checked in SMQ1 of my R/3 system and see that there are around 1000 records.On executing the delta package I see that the record count is reduced from 1000 to 400 in SMQ1.On executing the delta package again I get the remaining 400 records into my PSA.
    Shouldn't the delta package get all records from the queue on single execution??
    Is there some setting to define the nr of records to be loaded?
    I'm confused with this behaviour.Please help me understand this behaviour.
    Thank You.

    Hello,
          First thing: the data is not transferred from the SMQ1 queue, rather the data is transfered to BW from the RSA7 Delta queue. You need to check the number of records present in the RSA7 queue.
    Since SMQ1 is involved, i think you are using the unserialized V3 update method. In this method, when data is first written to the application tables, it is first transferred to the SMQ1 update queue,then via a job to the LBWQ extractor queue and then to the RSA7 delta queue. So the number of entries that you see in the SMQ1 queue are not the number of entries that have to be transferred to BW but rather the records that are waiting to be transferred to the extractor queue in LBWQ. Similarly, in LBWQ, the number of entries displayed here are not the no of entries that are going to be transferred to BW, they are the no of entries that will be transferred to the delta queue RSA7 when the next v3 update job runs.
    If you want to check the number of records that will be transferred to BW, select the datasource in rsa7 and then click on the display data entries button.
    Hope this helps.
    Regards.

  • Multi-track recording question

    Multi-track recording question
    Hey, just need some help on multi tracking using audition, hope this is the right forum?
    Wanted to know if anyone has a clue about assigning inputs from an audio interface to separate tracks on a recording program (ie: Adobe audition)
    I record live with my band alot, and have every amp and the kit mic'd up, but how do i make it so that each microphone is recording to a different track on the PC?
    My interface is an M audio fast track ultra, if that is of any use.
    Any advice appreciated! Thanks!

    FreeCT wrote:
    Wanted to know if anyone has a clue about assigning inputs from an audio interface to separate tracks on a recording program (ie: Adobe audition). I record live with my band alot, and have every amp and the kit mic'd up, but how do i make it so that each microphone is recording to a different track on the PC?
    In Audition, assuming that you can see all of the inputs available in the Hardware Setup, you find the right-facing arrow (input assign) on each track in MV's Main view, and you click on the box it's pointing to, go to Mono, and select the input you want for that particular track. The mono ones say [01M], [02M], etc. If you want to record a stereo track, then select the Stereo option where the inputs are paired and say [01S] et seq. This would have input 1 as left, input 2 as right.
    If you can't see all of the inputs available, try selecting the ASIO driver in Hardware Setup...

  • Retrieve All records and display in Report using CAML query in Report Builder if Parameter value is blank

    Hello Experts,
    i have created a report where i have one parameter field where user will pass parameter(e.g. EmpId). As per parameter record will fetched to report if no parameter is passed then it will display all records. I have done it by taking SqlServer Database as datasource.
    by using Following method
    Now i would like to do it by taking Sharepoint List as Datasource. For that what would be the CAML Query.
    Here is my existing CAML query.
    <RSSharePointList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <ListName>Employees</ListName>
      <ViewFields>
        <FieldRef Name="Title" />
        <FieldRef Name="FirstName" />
        <FieldRef Name="LastName" />
        <FieldRef Name="FullName" />
        <FieldRef Name="UserName" />
        <FieldRef Name="Company" />
      </ViewFields>
      <Query>
        <Where>  
    <Eq> 
        <FieldRef Name="Title" />
      <Value Type="Text">    
       <Parameter Name="EmployeeId"/>    
    </Value>
    </Eq>                  
        </Where>
      </Query>
    </RSSharePointList>
    The above code is working if i am passing an employeeId to Parameter. If nothing is passed, it is Not retrieving any record.
    Please suggest
    Thank you
    saroj
    saroj

    Your problem follows the well-established pattern of using an "All" parameter filter in SSRS. There are a few approaches depending on the size of your data. The easiest one is to return all data from CAML and then filter it within SSRS, the following thread
    provides some examples,
    http://stackoverflow.com/questions/18203317/show-all-records-some-records-based-on-parameter-value.
    Other options include passing all of the possible values within the CAML query when "All" is selected, using multiple Report Files to distinguish between both CAML queries, or to use multiple datasets with some logic to show/hide the correct one.
    Dimitri Ayrapetov (MCSE: SharePoint)

  • How to Use Property Loader to Load All Step Limits of SubSequence

    I have a MainSequence which have 7 Sequence Call Steps,and these Steps all have several Numeric Limit Test(LabVIEW Adapter),Now I want Creat a property Loader Step in the Setup Table of MainSequence to load all the SubSequences' Steps Limits.But I do not know how to realize it?Who Can help me,Thank you!

    It wasn't your english I just misread the question. I found this link that might help answer your question.
    http://forums.ni.com/ni/board/message?board.id=330&message.id=13163&requireLogin=False
    Hope it helps.
    Using LabVIEW 2010SP1 and TestStand 4.5

  • Can I turn off auto tab loading, if no, question about uninstalling newest version of firefox

    I tend to wind up with far too many tabs open at one time to not bog firefox down. I came up with a very useful workaround - close and re-open firefox with it disconnected from the internet.
    Thru version 3.6.19 this works beautifully, because when it can't find the internet, it loads all of the tabs as "problem loading page." They load quickly but don't use much memory and don't bog Firefox down that way. Then I connect to internet, and work the the tabs at my leisure. That way I have many tabs of pages I'm interested in ready for me, but only a few actually open and using memory etc.
    When I upgraded to the newest Firefox version, I had a lot of tabs already open but I discovered my workaround trick no longer works. As soon as I reconnect the internet, all the 'problem loading' tabs automatically start loading the full/real pages.
    QUESTION 1: Is there a way I can turn this function off, at least for awhile until I can work thru the set of tabs I already had loaded when I upgraded?
    QUESTION 2: Is there a way I can easily/quickly break a single window with a bunch of tabs into multiple windows? I mean WITHOUT having to handle each tab one by one...
    QUESTION 3: Is there some way to get a window listing all tabs and windows where I can delete selected tabs, while I have that window open? The dropdown on the righthand side of the page doesn't work for this, because it shows them all as 'problem loading page' rather than showing the url (or maybe there is a way to change the display in the dropdown menu?)
    Since I discovered this problem, I re-installed Firefox 3.6.19 (leaving the new Firefox version on the computer too). I did NOT make a new profile because I wanted it to see the session manager set of tabs I had already, my preferences & passwords, etc.... I am running 3.6.19, but I suspect it is having some problems because of both versions being on the computer with the single profile however, as its crashing more often and using more memory & CPU... I also tried to save the window in session manager (which I had before I loaded the new firefox), but got an error message.
    QUESTION 4: Is this likely the problem, e.g., two firefox versions but no new profile? IF so, is there a way to duplicate the profile so each firefox version has it's own, but both are identical?
    QUESTION 5: If uninstall the new Firefox, will the 3.6.19 version still run properly, with my profile, settings, session manager saved sessions, etc. all still intact?
    Thanks in advance for your help, I really need it!!

    Maybe:
    *Multiple Tab Handler: https://addons.mozilla.org/firefox/addon/multiple-tab-handler/

  • How to show all records (instead of unique records) in OBIEE Answers

    I am a newbie of OBIEE and have below question.
    The fact table has 3 fields:
    ID (Primary Key)
    Status (either 'open' or 'close')
    Amount
    There are 100 records in the fact table. When I drag the column Status into the Answers, the result returned is 2 records, 'open' and 'close'. Thus, seems Answers always returns unique records only.
    Can I achieve disabling such Answers feature such that all records will be shown? For above example, can the result returned all 100 records of either 'open' or 'close' ??
    Thank you very much.

    Hi,
    OBIEE is an analytical tool, it is there to help people see the value of numeric facts against one or more textual attributes. With that in mind OBIEE will always aggregate to the highest possible level when returning the results to you. In your case the highest level is status. If you include another column wich breaks the data down further then you will see it aggregated at that level. If you want to see individual records then you need to add a column which is unique for each record, usually you can use the column holding the identifier of the row from the source system, generally this is called Integration Id.
    Edit: After reading your post again, just add the ID column in your request and voila.
    Regards,
    Matt
    Edited by: mod100 on 13-Oct-2009 23:39

Maybe you are looking for