Global object that will hold data acroos different Class

Dear all,
I have a funciton like generateRecord(userid,date,seqno). Now I want java to check whether the userid,date,and seqno had been used before. So I dicided to write the following code
public Class UserRecord {
private List userArray = new ArrayList();
public addUserDetail ( UserDetail ud)
{   this.userArray.add(ud);}
Then I want to create a global variable object for the class UserRecord, because I want the object holds the user detail globally, I do that in another class
public Class TestAbc {
static public UserRecord ur;
UserDetail ud;
ur.userArray.add(ud);
Is the above code exist any problem?

Is the above code exist any problem?Did you tried running the program, it has many bugs?

Similar Messages

  • Is there a Java Obiect that will arrange data in alphabetical order?

    Is there a Java Obiect that will arrange data in alphabetical order?
    So no matter what order you add or put things into the object it will only return them in alphabetical order.
    Edited by: Easter1976 on Nov 5, 2007 9:55 AM

    No, you will either have to create a comparator, a sorter, or write the compareTo in such a way that it sorts your data by your wanted fields.
    So, given the class Student, you probably want something like this:
    public class Student implements Comparable<Student> {
         public int compareTo(Student s) {
              if (getLastName().compareTo(s.getLastName()) != 0)
                   return getLastName().compareTo(s.getLastName();
              if (getFirstName().compareTo(s.getFirstName()) != 0)
                   return getFirstName().compareTo(s.getFirstName();
              return 0;
    }After that, you may sort your list of students with Collections.sort(myListOfStudents);
    Alternatively, you may do it like this:
    Collections.sort(myListOfTypeSomething, new Comparator<Something>() {
         public int compare(o1, o2) {
              return o1.getAlphaSomething().compareTo(o2.getAlphaSomething());
         });

  • How can I set a DEFAULT zoom size at ctrl+++ that will hold while changing sites--even in private browsing?

    How can I set a DEFAULT zoom size at ctrl+++ that will hold while changing sites--even in Private Browsing?
    I'm just starting using Firefox but I won't be using it for long if I have to re-size the screen with every new location viewed.

    Try this add-on
    [https://addons.mozilla.org/en-US/firefox/addon/6965/ Default FullZoom Level ]

  • Is it possible to group 2 objects that are located on 2 different pages in InDesign CS4 JS

    Is it possible to group 2 objects that are located on 2 different pages. Would it be something like that:
            var myArray = new Array;
            //Add the items to the array.
            myArray.push(myLine1);
            myArray.push(myLine2);
            //Group the items.
            var myPages = app.activeDocument.pages;
            myGroup = myPage.groups.add(myArray);
    Thank you very much for your help.
    Yulia

    You can group objects from distinct pages only if they belong to the same spread.
    For instance, if you have a rectangle on page 2 and a rectangle on page 3 in a "facing pages" configuration, this should work:
    var doc = app.activeDocument;
    var r2 = doc.pages[1].rectangles[0]; // rectangle on page 2
    var r3 = doc.pages[2].rectangles[0]; // rectangle on page 3
    // it's better here to handle the parent spread:
    var g = doc.spreads[1].groups.add([r2,r3]);
    // but this may also work:
    // var g = doc.pages[1].groups.add([r2,r3]);
    // var g = doc.pages[2].groups.add([r2,r3]);
    @+
    Marc

  • Does anyone know about a company that will hold an itunes library.

    Help ! Relationship with significant other has gone south. I would like to get his itunes library off of my computer and put put in somewhere he can access it on a regular. Does anyone know of a company that will hold his library ? I don't want to be evil but 5000 songs is alot to lose

    I don't know of any such facility (although someone else may), but can't you burn all these songs to a few CDs or better still to a few DVDs (they hold much more info) and give them to him?
    He then has a permanent back up and you get to delete all of them from your computer.
    Not a viable solution?

  • View object that will allow to see data from two tables in a adf table

    Hi,
    I've been have serious issues to resolve this functional requirements with ADF.
    Basically I have two tables let say employee and department.
    A need a read only adf table to show the employees values but I don't want the users to see the department id, instead I want them to see the department name and all this in the same read only adf table.
    I created a view object based on such a query below:
    select employeelastname, employeefirstname, departmentname from employee, department where employee.departmentid = department.departmentid (+)
    Note the outer join here because some employees don't have department assigned but I still want to see them in my read only table.
    The problem is that the view object is based on a sql query and is using calculated attributes instead of entities and I am getting that error "rowkey does not have any primary key attributes" each time I select a row inmy adf read only table. So the popup I defined when the user select a row does not work properly and I need a better solution. I will also have the option for the users to delete a record selected in the read only table so really need entities behind there not just a view.
    My view object also include LOVs but I realized LOVs only work for tables but not for read only tables. Too bad the fonctionality is almost there... So even if I have lovs defined that show the data like I would like it to be seen for tables it does not help for ready only tables. Any way to have read only table working with LOVs (user will not be able to change the values or select another value in the list but at list they would see the department name instead of the department id)?
    Thanks to anyone that would be able to help me on this.
    Stephane

    Let me first say that I would use Shays approach and only under special circumstances (which are beyond this thread) use the solution outlined below:
    You can use the read only VO based on your query without basing it an entities. All you have to do is to mark one or more attributes as primary key in the VO. This should solve the "rowkey does not have any primary key attributes" error.
    Now to delete a row (I'm not sure which row department or employee you mean here) you use the selected read only row, get the PK of the row and call a service method in the application module of in a VO which is based on an entity and remove the row there. You can even use the removeRowWithKey operation from the data control to archive this.
    The second problem I don't understand. If you show the user a read only table there in no need to show a lov as you can't change the value. If your problem is that you need to show the department name instead of the department id, you simply add the department name to the attributes you select with your query.
    Timo

  • How to configure a audit in global zone that will audit all the zone

    Hi everyone,
    Please i want you guy to help me out on how i can configure an audit for my global zone that we audit all the zones that i have in global zone.
    I have a global zone , and i have like four zones under it, so i dont know how to configure a BSM audit for the global zone that we audit for all the zones.
    I will appreciate your swift response.
    Thanks and Regards.
    Ladi

    Most of the time each zone is treated as a separate server. This is my experience others might do it differently. All logs can then be sent to a log server and you will know that about the zone errors because the zone has a zone and/or host name. You can also login to the zone and check the logs there as well.
    The link below is for book from a guy who is much smarter then me. Read the security chapter.
    http://www.c0t0d0s0.org/pages/lksfbook.html

  • RFC FM that will select data from other system

    Hi ABAP Gurus,
    Good day.
    Do you have any documentation  on how to develop RFC FM that will be able select data from tables in other SAP system that you can share with me?  How about sample FMs?  Thanks in advance!
    Best regards.
    Brando Braganza

    HI Brando,
    see the below Function modules which help to fetch data from another system ..
    RFC_READ_TABLE                " External access to R/3 tables via RFC
                                                  "this function module is used for table which is having max 40 fields and unlimited records..
    RFC_GET_TABLE_ENTRIES      "Read table entries unlimited fields and data
    * call the FM like this
    *     Calling RFC to get Table entries from Destination 'AVP'
          CALL FUNCTION 'RFC_GET_TABLE_ENTRIES'  DESTINATION 'AVP'
    Regards,
    Prabhudas
    Edited by: Prabhu Das on May 12, 2009 10:52 PM

  • Looking for effect/plugin that will hold bright pixels above a threshold

    Does anyone know of an effect or plugin that will make pixels above a setable luminence threshold persist for a setable amount of time/frames? 
    Here's an example of this type of effect (go to 3 minute mark):
    Thank you!

    These Aharon Rabinowitz light writing tutorials are older but they should still be relatively valid for CS6.  They may give you some ideas for ways of making artificial light writing.
    http://library.creativecow.net/articles/rabinowitz_aharon/Light_Writing_Pt_1/video-tutoria l
    http://library.creativecow.net/articles/rabinowitz_aharon/Light_Writing_Pt_2/video-tutoria l

  • Saving "faces" info on photos that will be moved to different drive

    Before I start this project, I thought I would get the wisdom of the group.
    I will be going on trip and planned on copying my photo directory off a server to a MyBook external drive.
    I am thinking about using my down time to both edit and also use "faces" to ID many of the folks that I have in about 240 gig's of photos.
    While I have iPhoto and use it for iWeb projects etc, and of course for "faces" , I do most of my editing in Photoshop and don't store the great majority of photos in the iPhoto library.
    My question is, can I use "faces" on the images stored on the MyBook and later transfer that directory back to the server and retain the information?
    Will the information be available to other iPhoto users using different machines??
    Is the "faces" data written into Metadata, key words or XMP files that are used in Photoshop? And does it move as the file is transferred from disk to disk?
    Thanks
    Dunc

    My question is, can I use "faces" on the images stored on the MyBook and later transfer that directory back to the server and retain the information?
    You can use Faces only on pics in the iPhoto Library. The data is stored independent of the pics in DB files within the Library package. IF you move the Library then the data will move with it. If the other folks are sharing the same library, yes the data is available to them. IF, however, you export the photos there is no way to export the Faces data along with the pic, unless you use keywords.
    The faces data is not written to metadata, keywords or XMP data, and it does not move with the file, only with the Library.
    As the faces process gathers the pics for you, it’s easy to add keywords to the pics yourself.
    Regards
    TD

  • Is there a way to show/hide a group of objects that will work in html5?

    I consider myself to have a fairly decent understanding of captivate and its functions but this recent issue has stumped me.
    I have a button with javascript attached to it that runs a typical if loop: (pseudo code to follow)
    if(variable = 1){
    show "group" and variable = 0; 
    } else{
    hide "group" and variable = 1; 
    Now normally, I would do this with single images, etc, and it would work fine.  You click the button (the image being unticked where it says "visible in output") and the image shows itself, then you click the button, and it hides.  Very standard stuff.
    My issue, is that captivate seems to let you name a group you make....but they have not given you any control of that group.
    Problem:
    I want a way to show and hide a group of objects by only clicking one button (when published to html5).
    I want to only have to reference the group and dont want to need to write a separate line of code for every single component that makes up that group (assuming the solution has to be coded).
    Is it even possible to control groups like this within captivate?
    Thanks!

    There is an adobe video that I think shows how to do exactly what you are asking.
    This is the video link:
    Lightbox-style Menu in Adobe Captivate 6 - YouTube
    At about 10min 50sec, it goes over creating a group from a number of single elements.
    At about 12min 30sec, it shows creating an action that turns the whole group on and another to turn the group off.
    When I did this myself, I used just one action that toggled the group on or off, but they show it as two actions. The idea is the same.
    I hope that helps. Apologies if I mis-understood the issue.

  • Can you create an image map that will link to a different element on the same page?

    I have used image maps before and know how to create an image map to link to a new page.  In this case, however, I want to be able to click on my image using an image map and load a new image with text on the same page as the image map.  Is this even possible?  Is there some sort of behavior that allows you to create same-page links, perhaps using AP divs?  I want the end result to be a type of gallery that loads different images depending on where you click on the main image.
    Again, I don't even know if this is possible.  Any suggestions on how to make this work would be greatly appreciated.
    Thank you!

    Go to this site and mouse over the image map of South America.
    http://alt-web.com/testing.html
    Is that what you are looking for?
    Insofar as linking to a position on the same page, do a Help search (F1) in DW for "named anchors."
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • SQL Statement that will retrieve data from 1 table with 2 conditions

    Hi,
    I have a table "hz_cust_site_uses_all" and I need to retrieve primary_salesrep_id but with the following conditions:
    IF site_use_code = 'SHIP_TO' then
    if primary_salesrep_id is null then
    GET primary_salesrep_id where site_use_code = 'BILL_TO'
    else
    GET primary_salesrep_id;
    Sample Data:
    cust_acct_site_id primary_salesrep site_use_code
    1111 1000 BILL_TO
    1111 1001 SHIP_TO
    How will I convert it in an SELECT SQL statement.
    Thank you.
    Regards,
    Diane

    Starting in Oracle 9i, you can use the case statement within an SQL statement. It has the functionality of an IF-THEN-ELSE statement.
    The syntax for the case statement is:
    CASE [ expression ]
    WHEN condition_1 THEN result_1
    WHEN condition_2 THEN result_2
    WHEN condition_n THEN result_n
    ELSE result
    END
    For example:
    Select case when site_use_code ='SHIP_TO'
    and primary_salesrep_id is null
    then
    (select primary_salesrep_id
    from hz_cust_site_uses_all
    where site_use_code = 'BILL_TO')
    else
    primary_salesrep_id
    end
    from hz_cust_site_uses_all;
    hope this help you

  • Looking for an App that will hold Word Docs and allow editing

    Does Pages satisify this need?

    You are welcome. Glad I could help. Thanks for marking my reply with the solved check mark.
    Allan

  • Need help bout a query that will print data in matrix format..

    solved
    null

    SQL> create table mytable
      2  as
      3  select 'pranita' consultant_name, 'manager' designation, 'sohan' salesman from dual union all
      4  select 'pradeep', 'ceo', 'nick' from dual union all
      5  select 'sham', 'developer', 'prasad' from dual union all
      6  select 'john', 'designer', 'sohan' from dual union all
      7  select 'sam', 'developer', 'rajesh' from dual union all
      8  select 'pranita', 'manager', 'sohan' from dual union all
      9  select 'john', 'designer', 'anand' from dual union all
    10  select 'pradeep', 'ceo', 'rohit' from dual union all
    11  select 'sam', 'developer', 'nick' from dual
    12  /
    Tabel is aangemaakt.
    SQL> select consultant_name
      2       , designation
      3       , count(decode(salesman,'sohan',1)) "sohan"
      4       , count(decode(salesman,'nick',1)) "nick"
      5       , count(decode(salesman,'prasad',1)) "prasad"
      6       , count(decode(salesman,'rajesh',1)) "rajesh"
      7       , count(decode(salesman,'anand',1)) "anand"
      8       , count(decode(salesman,'rohit',1)) "rohit"
      9    from mytable
    10   group by consultant_name
    11       , designation
    12  /
    CONSULT DESIGNATI      sohan       nick     prasad     rajesh      anand      rohit
    sam     developer          0          1          0          1          0          0
    john    designer           1          0          0          0          1          0
    pradeep ceo                0          1          0          0          0          1
    sham    developer          0          0          1          0          0          0
    pranita manager            2          0          0          0          0          0
    5 rijen zijn geselecteerd.Regards,
    Rob.

Maybe you are looking for