Please help me........for writing enititybean with persistent state

I am new person in ejb,actually i am working on one module where ejb deployment
is there in websphere 4.0 with oracle database ,where as my module form is just retrieving
data from database for user but doest not create it.So according to sun specification
entity bean should have create() and findByPrimaryKey() methods but in my case i have to
just retrieve data i.e findByAllData(). Here i am passing a parameter institute_id,
which is not a primarykey in this table which retrives records under that particular institute id
but in my case entitybean doesn't initialize to any particular
primary id since create() method is not existing in my bean so container doesn't
have any account of primary key.So now it won't store the data in persistent
state in the container because of none of the create() method for primarykey.But
we want to store the data in entity bean in the appliaction server in the persistent
state so how it can be done.
==========================================
My databse table is :
Table ims_class_mst
columns class_id(primarykey),class_name,priority,institute_id
=============================================
My home interface is
public interface StcaHome extends javax.ejb.EJBHome {
public Collection findByAllPrimaryKey(Integer institute_id)
throws FinderException, RemoteException;
//collection is returning class_id,class_name through class stcakey and in parameter
//is institute_id
=======================================================================
My bean is:
public class StcaBean implements javax.ejb.EntityBean {
public int class_id;
public String class_name;
public int institute_id;
EntityContext ctx=null;
     public Collection ejbFindByAllPrimaryKey(Integer pk)throws FinderException
          Connection con = null;
          try{
               con = getConnection();
               PreparedStatement ps=con.prepareStatement("select class_id,class_name from ims_class_mst where institute_id = ?");
               ps.setInt(1,pk.intValue());
               ResultSet rs=ps.executeQuery();
               LinkedList queryMatches=new LinkedList();
               while(rs.next())
                    StcaKey stcakey=new StcaKey(rs.getString(1),rs.getString(2));
                    queryMatches.add(stcakey);
               rs.close();
               ps.close();
               return queryMatches;
          }catch(SQLException sqle)
               throw new EJBException(sqle);
          }finally{
               try{
                    if(con!=null)
                         con.close();
               }catch(SQLException sqle)
     private Connection getConnection()
          try{
               Context context = new InitialContext();
               DataSource datasource = (DataSource) context.lookup("java:comp/env/jdbc/SyllabusDB");
               return datasource.getConnection();
          }catch(javax.naming.NamingException namingexception)
               namingexception.printStackTrace();
               throw new EJBException(namingexception);
          }catch(java.sql.SQLException sqle)
               sqle.printStackTrace();
               throw new EJBException(sqle);
public int getClassId() {
return class_id;
public String getClassName() {
return class_name;
public void setEntityContext(EntityContext ctx) {
this.ctx=ctx;
public void unsetEntityContext() {
ctx=null;
public void ejbLoad() {
// Not implemented.
public void ejbStore() {
// Not implemented.
public void ejbRemove() {
// Not implemented.
==================================================================
My remote interface is
public interface Stca extends javax.ejb.EJBObject {
public int getClassId() throws RemoteException;
public String getClassName() throws RemoteException;
==================================================================
My primary key class is:
public class StcaKey implements java.io.Serializable
public String class_id;
public String class_name;
public StcaKey() {}
public StcaKey(java.lang.String class_id,java.lang.String class_name) {
this.class_id = class_id;
this.class_name = class_name;
public boolean equals(Object obj) {
if (obj instanceof StcaKey)
StcaKey otherKey = (StcaKey) obj;
return ((class_id.equals(otherKey.class_id)) && (class_name.equals(otherKey.class_name)));
else
return false;
public int hashCode() {
return ((class_id+class_name).hashCode());
==================================================================

Implement Load and Store methods .Data will be persisted.
-Viren Jasani

Similar Messages

  • HT204088 Dear sirs,  Could you please help me on my problem with my apple ID  I create new account with security questions, and when I try to purchase paid application,it ask me for answers the questions but it's not working,  My account have 50$ and stil

    Dear sirs,
    Could you please help me on my problem with my apple ID
    I create new account with security questions, and when I try to purchase paid application,it ask me for answers the questions but it's not working,
    My account have 50$ and still didn't buy anything

    You need to ask Apple to reset your security questions; ways of contacting them include clicking here and picking a method for your country, phoning AppleCare and asking for the Account Security team, and filling out and submitting this form.
    (100546)

  • I need make mac browsers with windows compatibility, because if i try to se priview from Dw to all browsers on windows PC it will look fine, but same file i trying to see on mac all browsers it will not showing proper..... Please help me for that.

    i need make mac browsers with windows compatibility, because if i try to se priview from Dw to all browsers on windows PC it will look fine, but same file i trying to see on mac all browsers it will not showing proper..... Please help me for that.

    ASk in the DW firum and be much more specific. Web page rendering issues are specific to specific versions of browsers and you may simply be using some bad code that messes up your page.
    Mylenium

  • Good evening I would please help me, IGood evening I would please help me, I have problems with flash player when update on my computer Flash Player for windows 8, gives me error in the installation that is not apply on my computer. Please help. Thank You

    Good evening I would please help me, IGood evening I would please help me, I have problems with flash player when update on my computer Flash Player for windows 8, gives me error in the installation that is not apply on my computer. Please help. Thank You

    First, confirm that ActiveX Filtering is configured to allow Flash content:
    https://forums.adobe.com/thread/867968
    Internet Explorer 11 introduces a number of changes both to how the browser identifies itself to remote web servers, and to how it processes JavaScript intended to target behaviors specific to Internet Explorer. Unfortunately, this means that content on some sites will be broken until the content provider changes their site to conform to the new development approach required by modern versions of IE.
    You can try to work around these issues by using Compatibility View:
    http://windows.microsoft.com/en-us/internet-explorer/use-compatibility-view#ie=ie-11
    If that is too inconvenient, using Google Chrome may be a preferable alternative.

  • When i run installation itunes,i see this massage "there is a problem with this windows installer package.a program required for this install to complete could not be run. contact your support personnel or package vendor."please help me for installation i

    when i run installation itunes,i see this massage "there is a problem with this windows installer package.a program required for this install to complete could not be run. contact your support personnel or package vendor."please help me for installation itunes on my pc completely.

    Apparently it's an itunes issue. I just tried to update and got the same issue. Called att to activate my iphone 4s and they say they can do the swap but apple is telling them itunes is down atm.  So will have to wait

  • Dear Friends, I am trying to draw a structure in Adobe Illustrator with 3D effect. But I am unable to give it proper shape. Can someone please help me for drawing the similar structure as showed below. I have facing problems in giving 3D effect.

    Dear Friends, I am trying to draw a structure in Adobe Illustrator with 3D effect. But I am unable to give it proper shape. Can someone please help me for drawing the similar structure as showed below. I have facing problems in giving 3D effect.
    Thanks a lot for your great help...

    i made a quick example:
    and what it's made of:
    just shapes and gradients. used a combination of pathfinder and shape builder to get the shapes exact.

  • Help needed for writing query

    help needed for writing query
    i have the following tables(with data) as mentioned below
    FK*-foregin key (SUBJECTS)
    FK**-foregin key (COMBINATION)
    1)SUBJECTS(table name)     
    SUB_ID(NUMBER) SUB_CODE(VARCHAR2) SUB_NAME (VARCHAR2)
    2           02           Computer Science
    3           03           Physics
    4           04           Chemistry
    5           05           Mathematics
    7           07           Commerce
    8           08           Computer Applications
    9           09           Biology
    2)COMBINATION
    COMB_ID(NUMBER) COMB_NAME(VARCHAR2) SUB_ID1(NUMBER(FK*)) SUB_ID2(NUMBER(FK*)) SUB_ID3(NUMBER(FK*)) SUBJ_ID4(NUMBER(FK*))
    383           S1      9           4           2           3
    384           S2      4           2           5           3
    ---------I actually designed the ABOVE table also like this
    3) a)COMBINATION
    COMB_ID(NUMBER) COMB_NAME(VARCHAR2)
    383           S1
    384           S2
    b)COMBINATION_DET
    COMBDET_ID(NUMBER) COMB_ID(FK**) SUB_ID(FK*)
    1               383          9
    2               383          4
    3               383          2
    4               383          3
    5               384          4
    6               384          2          
    7               384          5
    8               384          3
    Business rule: a combination consists of a maximum of 4 subjects (must contain)
    and the user is less relevant to a COMB_NAME(name of combinations) but user need
    the subjects contained in combinations
    i need the following output
    COMB_ID COMB_NAME SUBJECT1 SUBJECT2      SUBJECT3      SUBJECT4
    383     S1     Biology Chemistry      Computer Science Physics
    384     S2     Chemistry Computer Science Mathematics Physics
    or even this is enough(what i actually needed)
    COMB_ID     subjects
    383           Biology,Chemistry,Computer Science,Physics
    384           Chemistry,Computer Science,Mathematics,Physics
    you can use any of the COMBINATION table(either (2) or (3))
    and i want to know
    1)which design is good in this case
    (i think SUB_ID1,SUB_ID2,SUB_ID3,SUB_ID4 is not a
    good method to link with same table but if 4 subjects only(and must) comes
    detail table is not neccessary )
    now i am achieving the result by program-coding in C# after getting the rows from oracle
    i am using oracle 9i (also ODP.NET)
    i want to know how can i get the result in the stored procedure itsef.
    2)how it could be designed in any other way.
    any help/suggestion is welcome
    thanks for your time --Pradeesh

    Well I forgot the table-alias, here now with:
    SELECT C.COMB_ID
    , C.COMB_NAME
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID1) AS SUBJECT_NAME1
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID2) AS SUBJECT_NAME2
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID3) AS SUBJECT_NAME3
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID4) AS SUBJECT_NAME4
    FROM COMBINATION C;
    As you need exactly 4 subjects, the columns-solution is just fine I would say.

  • HT4436 I am using IOS 4.1 in Ipod touch. I would like to take my data back using icloud. I am not able to enable icloud in to my ipod touch. please help me for the same.

    I am using IOS 4.1 in Ipod touch. I would like to take my data back using icloud. I am not able to enable icloud in to my ipod touch. please help me for the same. Basically I am trying to take back to upgrade my ios to 5 or 6 version.

    You can't back up to iCloud until you update to iOS 5 or higher.  You will have to back up your iPod on your computer using iTunes.  Update iTunes on your computer to the latest version, then connect your iPod to your computer, open iTunes, if iTunes give you a pop-up asking if you want to update your iPod, decline.  Then click on the name of your iPod in iTunes, go to File>Devices>Transfer Purchases to transfer any purchased media to your iTunes library.  Next, go to the Summary tab of your iTunes sync settings and click on Back Up Now to back up your iPod on your computer.
    When it's done backing up, click on Check for Update (or Update) on the Summary tab of your iTunes sync settings.  Allow your iPod to update, and leave it connected to your computer.  At the end, it will restart and give you the option to restore to the iTunes backup you made earlier.  Choose this option to restore your backup and sync your apps and other iTuens media to your phone.
    This process is outlined in this article: http://support.apple.com/kb/HT4972, under "If you are attempting to update using a Mac or PC with which you normally sync".

  • I want to check all functions of PCI 6534.I have read the user manual..I have some memory related questions.​Please help me for that.

    I want to check all functions of PCI 6534.I have read the user manual..I have some memory related questions.Please help me for that.
    1.)If i am using the continuous output mode.and the size of generated data is less than 32 MB.If i want to preload the memory,what should i do?I want that first of all i load all my data to onboard memory & then i want to make start the transfer between 6534 & peripheral.Is it possible?As per me it should be.Plz tell me how should i do this?I think that in normal procedure the transfer between 6534-peripheral & outputting data from pc buffer to onboard memory works parallely.But i don't want this.Is it poss
    ible?
    (2).Similarly in finite input operation(pattern I/O) is it possible to preload the memory and then i read it?Because i think that the PC memory will be loaded automatically when 6534 acquires the data and then when we use DIO read vi the pc buffer data will be transferred to application buffer.If this is true,i do not want this.Is it possible?
    (3) One more question is there if i am using normal operation onboard memory will be used bydefault right?Now if i want to use DMA and if i have data of 512 bytes to acquire.How will it work and how should i do it?Please tell me the sequence of operations.As per my knowledge in normal DMA operation we have 32 Bytes FIFO is there so after acquisition of 32 bytes only i can read it.How it will known to me that 32 bytes acquisition is complete?Next,If i want to acquire each byte separately using DMA interrupts what should i do?Provide me the name of sourse from which i can get details about onboard memory & DMA process of 6534 specifically
    (4).In 6534 pattern Input mode,if i want to but only 10 bits of data.and i don't want to waste any data line what should i do?

    Hi Vishal,
    I'll try to answer your questions as best I can.
    1) It is definitely possible to preload data to the 32MB memory (per group) and start the acquisition after you have preloaded the memory. There are example programs on ni.com/support under Example Code for pattern generation and the 6534 that demonstrate which functions to use for this. Also, if your PC memory buffer is less than 32MB, it will automatically be loaded to the card. If you are in continuous mode however, you can choose to loop using the on-board memory or you can constantly be reading the PC memory buffer as you update it with your application environment.
    2) Yes, your data will automatically be loaded into the card's onboard memory. It will however be transferred as quickly as possible to the DMA FIFO on the card and then transferred to the PC memory buffer through DMA. It is not going to wait until the whole onboard memory is filled before it transfers. It will transfer throughout the acquisition process.
    3) Vishal, searching the example programs will give you many of the details of programming this type of application. I don't know you application software so I can't give you the exact functions but it is easiest to look at the examples on the net (or the shipping examples with your software). Now if you are acquiring 512 bytes of data, you will start to fill your onboard memory and at the same time, data will be sent to the DMA FIFO. When the FIFO is ready to send data to the PC memory buffer, it will (the exact algorithm is dependent on many things regarding how large the DMA packet is etc.).
    4) If I understand you correctly, you want to know if you waste the other 6 bits if you only need to acquire on 10 lines. The answer to this is Yes. Although you are only acquiring 10 bits, it is acquired as a complete word (16bits) and packed and sent using DMA. You application software (NI-DAQ driver) will filter out the last 6 bits of non-data.
    Hope that answers your questions. Once again, the example code on the NI site is a great place to start this type of project. Have a good day.
    Ron

  • I have to upload video from my hewlett packard t200 camcorder to my mac. but mac won't recognize the camcorder files. i even bought flip4mac by tele stream which so far is useless. please help me use my camcorder with my iMac os mountain lion 10.8.2

    i have to upload video from my hewlett packard t200 camcorder to my mac. but mac won't recognize the camcorder files. i even bought flip4mac by tele stream which so far is useless. please help me use my camcorder with my iMac os mountain lion 10.8.2
    i tried to get the installation disc for the camcorder but mac wont' recognize it becaue it is windows based i guess.
    i just bought the camcorder a few months ago and when my computer crashed thought i'm finally getting a mac...it's been a costly venture which has resulted in more frustration than before my pc.
    now the things i want to use with my mac that i thought would be even simpler...are not even useable...
    help

    That camera shoots H.264 in an .avi wrapper.
    You will have to transfer the files via the Finder.
    Get a free copy of MPEG Streamclip and convert them to QuickTime .mov using the H.264 codec if you are presumably editing in iMovie.
    Note that your list of video codecs won't look like mine as I have Final Cut Pro, but H.264 is definitely an option for you.

  • I'm unable to play game in hp 15-r009TU.. what can i do for this. please help me for this

    i'm unable to play game in hp 15-r009TU.. what can i do for this. please help me for this

    Hi Madhuama, I'll try to give you a hand with this. First off, what OS is running on your notebook, what game are you attempting to play, and how is it not working? Is it not installing?
    Thanks,
    Fenian Frank
    I work on behalf of HP

  • I want to transfer my Adobe CS3 licence to my new Laptop. Please help me for Deactivate Adobe CS3 licence from old Laptop

    I want to transfer my Adobe CS3 licence to my new Laptop.
    Please help me for Deactivate Adobe CS3 licence from old Laptop

    Hi sanket chalke,
    I'm not sure what Adobe product you need help with, but you might want to start with this document, which has deactivation information: Activation & Deactivation Help
    Please let us know how it goes.
    Best,
    Sara

  • Could you please help me in writing query

    Hi,
    Data in table
    ID -- H_squ -- D_squ --- Note
    0001 1 1 he is
    0001 1 2 coming
    0001 1 3 from US
    0001 2 2 he is going
    0001 2 5 Back to US
    0002 1 3 he took
    0002 1 2 his laguage
    0002 2 3 bi
    output shouldbe
    ID -- H_squ -- D_squ --- Note
    <0001> <1> <1,2,3> <he is coming from US>
    <0001> < 2 > <2,5> < he is going Back to US>
    <0002> <1> <3,2> <he took his laguage>
    <0002> <2> <3> <bi>
    Actually I used STRAGG function But i am not getting expected output
    group by ID, H_squ concat data order by D_squ column
    Note should contain concat of D_squ(1,2,3) in this order
    Could you please help me in writing query

    This forum is for issues related to Advanced Queuing.
    Please only post in forums where your questions are appropriate.

  • Please help me for create flash boot in windos os

    hi .my mac book is crash hard disk .i dont acses to enother macbook pro for create botable flash disk .please help me for make botable flash disk in windos 7 for instal and create partishen new hard disk.thanks

    We are not macbook pro forum, question about Windows and Boot Camp should go there, not knowing your mac but likely has internet recovery that works even with a "crash" hdd. I assume you know how to go about swapping out for a new one (time to get an SSD) or you can just boot from Windows w/o flash and install, all w/o Boot Camp Assistant.
    www.macsales.com sells kits - empty external case for old drive, new drive or ssd, and also memory upgrades.
    And you can install Mac OS to any external drive. Like your backup TimeMachine and just shrink and make a 40GB partition for OS X.

  • Help me for writing the password script on solaris

    hi,
    help me for writing password scripts to change the user/root password.
    in the script itself myself want to mention the new password.
    now user want to login with the new password only.
    model script:
    echo $test:`perl -e '$x=crypt('$test123','test');
                   print $x'`::::::: >> /etc/shadow
    test--->username
    test123---->new password.
    the above script is not working.
    kindly help me for writing the script.
    Regards,
    raja

    Well. For one thing, if you just append the new password to the /etc/shadow file there will be two entries for the user in that file (at least if the user already had a password). Which probably is a bad thing.

Maybe you are looking for

  • Compatiblity check for DB2E 8.2.4 with SAP MI Client 2.5 SP 20

    Hi all, We  are developing a mobile sales application for CRM using xapps MSAHH 5.0. We are using SAP MI 2.5 SP 20 and DB2E 8.2.4 . We have configured the backend for activity related data, but when try to run the application on client it is giving a

  • HTMLDB - Support HGrid or Hierachical Tree Table Grid?

    When is HTMLDB going to support more advanced GUI controls such as the HGrid or "tree table grid"? I want to display a hierarchy of objects in a tabular format. Thanks! -Kathryn

  • No styles or effects in PSE 10

    I installed an action in my PSE 10 It did not work and kept layer styles and photo effects from showing up.  I deleted the action--still not showing up so I reset my computer to a time prior to the installation--still no styles or effects.  What is w

  • P35 Neo2 BIOS Settings to run Dual Boot SATA and IDE HD's

    Hi, I was having intermittent problems with a Gigeabyte so upgraded M/B. I have an IDE "caddy" with 2 Dual boot HD's (Linux Grub booting XP on sda1 and Fedora9 on sda2), and had no problems with either HD's on old M/B. The old M/B also had  SATA sock

  • Can't install Msn messenger.....

    Hi all, I've tried different versions, but always the same.... I've tried dragging the downloaded .dmg to my applications folder, and just double clicking on the icon also but nothing happens... Can anyone help? Thanks in advance Pat Powerbook G4 (86