Type of collection to use?

I get a project Id from the database (oracle), search through webpages which have the same data, and the same projectID, but is in a differenct location. Extract data from the different websites, and insert the collected data into the database under the same project ID. The project Ids can either be numeric, or String.
Any oppinion on which collection I should use? List, arrayList, RecordSet, etc...
As of now I have only three classes. A document class - which just has getters and setters for my records/document. a DBConnection class which does the db connections stuff, and a URLReader class that does all the stuff between.

ArrayList sounds fine for collecting data

Similar Messages

  • Exception: "The type "Collection" as used in the variable/parameter declarations

    I am getting the following exception when I try to run the test code.
    What could be causing it ?
    I am running Kodo 2.4.3 with JDK 1.4.1
    EXCEPTION
    javax.jdo.JDOFatalInternalException: [agencyNames:[AGENCY1, AGENCY2]]
    NestedThrowables:
    javax.jdo.JDOUserException: The type "Collection" as used in the
    variable/parameter declarations could not be found in the imports.
    TEST CODE
    JDOFactory jdoFactory = new JDOFactory();
    PersistenceManager pm = jdoFactory.getPersistenceManager("");
    try
    Class agencyClass = Agency.class;
    Extent agencyExtent = pm.getExtent(agencyClass, false);
    String filter = "agencyNames.contains(agencyName)";
    List agencyNames = Arrays.asList(new String[]{"AGENCY1",
    "AGENCY2"});
    String param = "Collection agencyNames";
    Query q = pm.newQuery(agencyExtent, filter);
    q.declareParameters(param);
    Collection deps = (Collection) q.execute(agencyNames);
    System.out.println("SIZE :" + deps.size());
    catch (Exception ex)
    ex.printStackTrace();
    JDO Mapping and Class
    package test;
    import java.util.*;
    public class Agency
    private String agencyName;
    private String hostCarrierCode;
    //Getter and Setter
    public static class Id
    public String agencyName;
    public String hostCarrierCode;
    //Application ID definition
    ?xml version="1.0"?>
    <jdo>
    <package name="test">
    <class name="Agency" identity-type="application"
    objectid-class="Agency$Id">
    <extension vendor-name="kodo" key="table" value="AGENCIES"/>
    <extension vendor-name="kodo" key="lock-column" value="none"/>
    <extension vendor-name="kodo" key="class-column" value="none"/>
    <field name="agencyName" primary-key="true">
    <extension vendor-name="kodo" key="data-column"
    value="AGENCY_NAME"/>
    </field>
    <field name="hostCarrierCode" primary-key="true" >
    <extension vendor-name="kodo" key="data-column"
    value="CARRIER_CODE"/>
    </field>
    </class>
    </package>
    </jdo>

    Kodo 2.4.3 does not support using collections as parameters.
    Kodo 2.5.0, due to be released shortly, does support this. See
    http://solarmetric.com/Software/beta/2.5.0 to get the latest release
    candidate.
    -Patrick
    On Thu, 05 Jun 2003 22:26:36 +0000, B K Adarsh wrote:
    I am getting the following exception when I try to run the test code.
    What could be causing it ?
    I am running Kodo 2.4.3 with JDK 1.4.1
    EXCEPTION
    javax.jdo.JDOFatalInternalException: [agencyNames:[AGENCY1, AGENCY2]]
    NestedThrowables:
    javax.jdo.JDOUserException: The type "Collection" as used in the
    variable/parameter declarations could not be found in the imports.
    TEST CODE
    JDOFactory jdoFactory = new JDOFactory();
    PersistenceManager pm = jdoFactory.getPersistenceManager("");
    try
    Class agencyClass = Agency.class;
    Extent agencyExtent = pm.getExtent(agencyClass, false);
    String filter = "agencyNames.contains(agencyName)";
    List agencyNames = Arrays.asList(new String[]{"AGENCY1",
    "AGENCY2"});
    String param = "Collection agencyNames";
    Query q = pm.newQuery(agencyExtent, filter);
    q.declareParameters(param);
    Collection deps = (Collection) q.execute(agencyNames);
    System.out.println("SIZE :" + deps.size());
    catch (Exception ex)
    ex.printStackTrace();
    JDO Mapping and Class
    package test;
    import java.util.*;
    public class Agency
    private String agencyName;
    private String hostCarrierCode;
    //Getter and Setter
    public static class Id
    public String agencyName;
    public String hostCarrierCode;
    //Application ID definition
    ?xml version="1.0"?>
    <jdo>
    <package name="test">
    <class name="Agency" identity-type="application"
    objectid-class="Agency$Id">
    <extension vendor-name="kodo" key="table" value="AGENCIES"/>
    <extension vendor-name="kodo" key="lock-column" value="none"/>
    <extension vendor-name="kodo" key="class-column" value="none"/>
    <field name="agencyName" primary-key="true">
    <extension vendor-name="kodo" key="data-column"
    value="AGENCY_NAME"/>
    </field>
    <field name="hostCarrierCode" primary-key="true" >
    <extension vendor-name="kodo" key="data-column"
    value="CARRIER_CODE"/>
    </field>
    </class>
    </package>
    </jdo>--
    Patrick Linskey
    SolarMetric Inc.

  • Which order type gets collected and is used for forecast consumption

    Hi all,
    I would like to know which Order Types (transaction types) get collected into ASCP (appear as demand) and which Order Types are used for forecast consumption.
    I tried to find something in the user guides, but had not yet success :(
    What I want to do:
    1. decide which order types are collected or not
    2. decide which order types consume forecast or not
    Anyone any advices?
    Big thanks in advance,
    David.

    Hi,
    Rather speaking like Order types, we may use word Sales Order. ASCP will collect all the Sales Orders for which we need to intiate action for Supplies. How it is determined?. It is determined from SO lines where in we have So lines are scheduled(it is prt of Workflow action too) and It is flaged 'Yes' for "Visible Demand Flag" . This is what designed functionality. We do not care what type of order type it is.
    thanks,
    dr

  • How to exclude stock of a particular storage type from collective availabil

    How to exclude stock of a particular storage type from collective availability check in MDVP.

    you can set the storage location as 'Storage location stock excluded from MRP' value '1' in the field
    Sloc MRP indicator , in MRP view $ when you enter a storage location accessing the material master.
    Thsi is the only way to exclude the storage location, you have to do it per each material and also it is excluded from the MRP.
    With this option the stock is not considered in ATP.
    IF you need the storage location in the MRP, then you should consider the use of MRP Areas.
    With the MRP Areas you define which plants/storage locations belong to each MRP area and the ATP is performed for eah area with the stocks that exist in each of them.
    Please if the issue is solved set the thread  as answered and provide the points to the useful replies.
    thanks for your cooperation

  • Which type of collection is suitable for below scenario?

    which type of collection is suitable for below scenario?
    A) session.getAttibute("userPref",dad_re);
    possible values inside session are rad_eu,tcd_nid,aa,iod_po
    B)Need to compare with below set of values .
    dad_re
    rad_eu
    aad_vv
    bbd_rt
    ccd_ff
    If matched
    sysout("Matched values"+rad_eu)
    else
      sysout("Non matching with B"+tcd_ni)
    A - will contain only one value for each time and it is superset
    Which collection will use to store B?

    A HashSet.

  • Memory cost of each type of Collection class

    Hi, I wonder what is the memory cost of each type of Collection?
    Suppose I want to keep a set of non-duplicate objects, HashSet removes duplicates automatically, but calculating hash is extra cost; instead i can use ArrayList and do a check "if contains, then adds" before adding an element. Which one is faster? And which costs less memory?
    Thanks alot!

    Use a Set, that's what it is there for.

  • Type Safe Collections

    Hello All,
    I want to have type safe collections. Today. when we do programming with collections it almost behaves like a scripting language with no data types. any thing which is an object goes in and comes out freely.
    what about having a Collection(vector, ArrayList) class which can contain objects of only one type.
    something like
    ArrayList<Integer> a = new ArrayList();
    regards,
    Abhishek.

    Here's my way of using generics in normal Java - not quite as good as a compile error - but it works, and gives you a runtime error on inserting an object of the wrong type.
    I did this when at Uni, hence all the funky comments (well, you can't expect the lecturers to actually read the code, can you?).
    Just something you may find useful:
    import java.util.*;
    ���An implementation of the Proxy pattern, designed to wrap any list, and make it accept
    ���objects of the specified type (subclasses are allowed) only, hence allowing a user of
    ���this class to 'trust' the Proxy list.
    public class TypeSafeList extends AbstractList implements Serializable
    ���protected List source;
    ���protected Class acceptable;
    ���/**
    ������@param list the list to assign.
    ������@exception java.lang.IllegalArgumentException if the list contains elements of a
    ������different type to that specified
    ���*/
    ���public TypeSafeList(List list,Class acceptable)
    ���{
    ������Iterator iterator = list.iterator();
    ������while( iterator.hasNext() )
    ���������if( !acceptable.isInstance( iterator.next() ) )
    ������������throw new IllegalArgumentException( list+" contains elements not of type "+acceptable);
    ������this.source=list;
    ������this.acceptable=acceptable;
    ���}
    ���/**
    ������Passes on the request to the underlying list. See java.util.List.
    ���*/
    ���public Object get(int index)
    ���{
    ������return source.get(index);
    ���}
    ���/**
    ������Passes on the request to the underlying list. See java.util.List.
    ���*/
    ���public int size()
    ���{
    ������return source.size();
    ���}
    ���/**
    ������Checks that the type of the parameter is valid, and then passes on the
    ������request to the underlying list. See java.util.List.
    ������
    ������@exception java.lang.IllegalArgumentException if the type of the parameter is
    ������invalid.
    ���*/
    ���public Object set(int index,Object element)
    ���{
    ������return source.set(index,checkType(element));
    ���}
    ���/**
    ������Passes on the request to the underlying list. See java.util.List.
    ���*/
    ���public Object remove(int index)
    ���{
    ������return source.remove(index);
    ���}
    ���/**
    ������Checks that the type of the parameter is valid, and then passes on the
    ������request to the underlying list. See java.util.List.
    ���*/���
    ���public void add(int index,Object object)
    ���{
    ������source.add(index,checkType(object));
    ���}
    ���/**
    ������Return the Class object this List is configured to accept.
    ���*/
    ���public Class getAcceptable()
    ���{
    ������return acceptable;
    ���}
    ���
    ���/**���
    ������Checks the validity of the parameter against the protected field 'acceptable'.
    ������@return object if object is valid.
    ������@exception java.lang.IllegalArgumentException if the argument is invalid.
    ���*/
    ���protected Object checkType(Object object) throws IllegalArgumentException
    ���{
    ������if (acceptable.isInstance(object))
    ���������return object;
    ������throw new IllegalArgumentException(object+" needs to be of type "+acceptable.getName());
    ���}
    }

  • Not able to set security group without mail enabled as site collection admin using powershell in sharepoint online site - office 365

    not able to set security group without mail enabled as site collection admin using powershell in sharepoint online site - office 365?
    Any idea?

    after few days test in my lab, I can see that only email enabled group can be added as site collection admin using POWERSHELL.
    hope this helps who stuck like me!! :-)

  • I need to reprogram the delete and enter key to the left side of a external keyboard for the ipad mini. don't need the caps/lock or ctrl key and due to an injury my daughter can only use her left hand to type. She is using a text to speech app to verbaliz

    I need to reprogram the delete and enter key to the left side of a external keyboard for the ipad mini. I don't need the caps/lock or ctrl key. Due to a brain injury my daughter can only use her left hand to type. She also uses a text to speech app to verbalize all of her needs since her speech isn't intelligible any longer either. And her vision was significantly affected also, so the keyboard has to be mounted about 6 inches from her face. So to reach across the keyboard with her left hand to the right side delete and enter button is physically difficult and causes typing errors, which cause people to not understand what shes trying to say.
    The best keyboard so far is the Zagg folio mini. I just had to make stickers to enlarge the letters on the key buttons.
    Does anyone know how I can reprogram these two keys? Or where I can buy a wireless mini keyboard for Ipad made for lefthanders with these two functions on the left side. I have searched for days and days. It's sooooo important to me that she be able to contribute her voice again. Imagine if you got in a car accident and couldn't speak clearly any longer, but understood everything still. Thanks for any help and suggestions you all take the time to share with me. I really appreciate the kindness of strangers to help me help my daughter.
    Sami's mom

    Sami\'s mom wrote:
    I need to reprogram the delete and enter key to the left side of a external keyboard for the ipad mini.
    You cannot.

  • Since downloading Firefox 4, I am having problems archiving gmail conversations from my inbox view. Also, when I go to enter a new event in google calendar, I now have to click the cursor in the box to type the event (it used to let me just start typing).

    Since downloading Firefox 4, I am having problems archiving gmail conversations from my inbox view (either one or several conversations) as it says "No Conversations Selected" when I have selected one or several. Also, when I go to enter a new event in google calendar, I have to click the cursor in the box to type the event (it used to let me just start typing) or else it flips out and starts jumping to day view or another month. Does anyone know how to fix either of these?

    I have had this problem; but while trying to fix another problem, I reset my preferences for Firefox and it fixed this problem as well. To reset preferences, follow this link: http://support.mozilla.com/en-US/kb/Resetting%20preferences

  • Transaction type 100 cannot be used for activity 'Acquisition from invoice'

    Hi
    My user got the error message : Transaction type 100 cannot be used for activity 'Acquisition from invoice receipt w/ affil. comp.'
    when post the invoice via MIRO t code for 98% of the total amount.
    The posting was is related to affiliated company, & by right it should pick transaction type 153 but it is pointing to 100.
    If user post 100% , no error.
    Please advice.

    Check any of the following notes:-
    =>  Note 972556 - MIRO: Incorrect movement type with affiliated companies
    =>  Note 1060719 - Error AAPO 176 for postings from Logistics without vendor
    thanks
    G. Lakshmipathi

  • Internal class type 023 cannot be used in class maintenance

    Dear PP gurus,
    I am creating class from  t code CL01 and  while entering class type 023         , i am getting a error message
    "Internal class type 023 cannot be used in class maintenance" . when i pressed F4 , in the list 023 is not present.
    In the develpopment client , when i do the same  023 , it allows be to create class
    pls help me wher i am missing or?
    Regards

    Hello All,
    I am facing a similar problem.
    I have checked the following customization "SPRO --> Cross Application component -->Classification system --> Class --> Maintain Object type and class,
    Here select the MARA table click on the object and check class type 023 is assigned or not."
    Class type 023 is not assigned there. When i try to add a new entry I get the following error message
    "Specify the key within the work area".
    I referred to the following note :OSS Note 1066606, but that is concerned with AFS component.
    Kindly provide me a solution as soon as possible.
    Regards,
    Julia

  • How to set security group as primary site collection admin and secondary site collection admin using powershell in sharepoint online site - office 365?

    How to set security group as primary site collection admin and secondary site collection admin using powershell in sharepoint online site - office 365?

    Hi,
    According to your description, my understanding is that you want to set security group as admin of primary and secondary site collection using PowerShell command in office 365.
    I suggest you can use the command below to set the group to site owner, then it will have the site collection admin permission.
    Set-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 -Owner [email protected] -NoWait
    Here are some detailed articles for your reference:
    https://technet.microsoft.com/en-us/library/fp161394(v=office.15)
    http://blogs.realdolmen.com/experts/2013/08/16/managing-sharepoint-online-with-powershell/
    Thanks
    Best Regards
    Jerry Guo
    TechNet Community Support

  • Showing bangla character in all types of java mobile using bitmap fonts

    i am a new user of j2me.but i cannot find any helps.
    i want to do english to bangla dictionary for all types of java mobile using bitmap
    fonts.
    initially how can i display bangla character using bitmap font in non unicode supported java mobile???
    but i cant do it.
    please send me source code or any helping resource.
    i am waiting for your reply.

    More info; installed mplayer2 which should work better with vdpau and this happened;
    VO: [vdpau] 800x468 => 800x468 Planar YV12
    [vdpau] Got display refresh rate 60.015 Hz.
    [vdpau] If that value looks wrong give the -vo vdpau:fps=X suboption manually.
    A: 6.3 V: 6.4 A-V: -0.000 ct: 0.000 0/ 0 1% 2% 0.2% 0 0
    [h264 @ 0xb6b41640]left block unavailable for requested intra mode at 0 23
    [h264 @ 0xb6b41640]error while decoding MB 0 23, bytestream (1111)
    [h264 @ 0xb6b41640]concealing 399 DC, 399 AC, 399 MV errors
    A: 6.5 V: 6.6 A-V: 0.000 ct: -0.000 0/ 0 1% 2% 0.2% 0 0
    Seek failed
    Seek failed
    Seek failed
    Seek failed
    Seek failed
    Seek failed
    Alot of those "Seek failed"!

  • 1067: Implicit coercion of a value of type void to an unrelated type mx.collections:ArrayCollection.

    Here is what I have going on.
    When a button in my app is clicked it will instantiate a new object called ButtonCommand, within that object I create a new instance of a ListVO called vo.  I then reference my model object that also has a separate instance of the same Value Object ListVO class, reference its properties and place it into the corresponding property of the new VO object. Here is the code.
    var vo:ListVO = new ListVO();
    vo.name = model.list.name;
    vo.id = model.list.id;
    vo.amount = model.list.amount;
    vo.category = model.list.category;
    Within that same ButtonCommand class, next line I am trying to add the new ListVO instance to an arrayCollection that is also referenced from my model object, so here is the code for that.
    model.listCollection = model.listCollection.addItem(vo);
    I get the following error : -1067: Implicit coercion of a value of type void to an unrelated type mx.collections:ArrayCollection.
    And here is my getter/setter for the model.listCollection.
    public function get listCollection ():ArrayCollection
          return _listCollection;
    public function set listCollection(value:ArrayCollection):void
          _listCollection = value;
    Any Ideas?

    I thought model.listCollection is an ArrayCollection?
    model.listCollection is an ArrayCollection as shown in the example model code a few posts back.
    public class Model extends Actor
         //- PROPERTIES - //
         //-- other properties are here
         private var _listCollection:ArrayCollection = new ArrayCollection();
         public function Model()
         super();
         //other getter and setters here
         public function get listCollection ():ArrayCollection
         return _listCollection;
         public function set listCollection(value:ArrayCollection):void
         _listCollection = value;
    I am finding this to be very odd, seems like a simple getter setter situation, but I feel I must be missing something. The code trace(model.listCollection); should trace out as an ArrayCollection and not the VO object I am trying to add to it. Also when i run the code model.listCollection.addItem(vo); it should add the vo to the array collection through my setter, but yet it seems to try to access my getter.
    I took Kglads advice and traced out  _listCollection within my getter before my return statement and it returns [object ListVO]..... confused for sure. I am going to change the _listCollection property in the model from private with a getter/setter to a public and see what happens.

Maybe you are looking for

  • How can I open encrypted files from a flash drive?

    I moved transferred files from my work PC to a flash drive and had to encrypt them using Credant.  I know the password but can't find a way to decrypt the files on my mac...

  • Payment of Invoices before GRN

    Dear All, We need your help to improve our payment process.  As we are sending various shipments via ocean freight to save on transport costs, all USA based supplier's invoices become due prior to the shipment arriving at our location. Currently the

  • Is this a Bug or Feature?

    I would not expect this to work at all, but it does: CREATE TABLE WDD.TABLE_1 ID_1 NUMBER NOT NULL CREATE TABLE WDD.TABLE_2 ID_2 NUMBER NOT NULL SELECT TAB.ID_1, TAB.ID_2 FROM TABLE_1 TAB, TABLE_2 TAB WHERE TAB.ID_1 = TAB.ID_2 I guess that it works b

  • Back ground job work in MM

    CAN ANY BODY TELL ME WHAT IS A BACK GROUND JOB WORK IN MM pls explain it with good example tell me 1 or  2back ground job work relevent transactions good answer will be awarded kiran

  • Links in the document are not working

    Hi All,   In my program there shows a document, if the document has any hyper links, upon clicking on the link, its not going to concerned document. Can you all please help me? Thanks in advance. Best Regards, Prasanth