Skip to Content
avatar image
Former Member

calling an EJB application in webdynpro

Dear SDN's,

I am trying to call an EJB application from a webdynpro application and is succeded in storing values to database via Java Bean Model.

I want to retrieve all records from table via EJB and all the records should be displayed in Webdynpro Table UI element.

How can we do it?

The problem here is, how to return a set of records to webdynpro from EJB via a javabean.

I am not clear in using Collection Framework! i.e, which collection class i have to use to store the retrieved records.

Your help will be appreciated.

Regards,

Sireesha.B

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Dec 14, 2006 at 09:58 AM

    Hi Sireesha,

    Use Vector or ArrayList

    Regards, ANilkumar

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Sireesha,

      Instead of adding resultset, create a EMP cinstance and add it.

      Ex : Consider you have created a EMP class

      class EMP

      {

      String empname;

      int id;

      public void setEmpname(String name);

      public String getEmpname();

      ...............

      }

      Now

      ResultSet rs=statement.executeQuery(select * from emp);

      Vector v=new Vector();

      while(rs.next)

      {

      Emp e=new EMP()l

      e.setEmpName(rs.getString(0));

      e.setID(rs.getInt(1)));

      v.add(emp);

      }

      Iterator i=v.iterator();

      while(i.hasNext())

      {

      Emp e1=(EMP)i.next()l

      System.out.println(e1.getempName());

      System.out.println(e1.getID);

      }

      Regards, ANilkumar

  • Dec 14, 2006 at 10:49 AM

    Hi Sireesha,

    U can Retrive the Record By using any one of Hahset , HashMap, Arraylist,Treeset,Linked List,Table,Enum Set,Queue.

    U can access ur Each record in the collection by using Iterator.

    Iterator :

    It enables you to cycle through a collection,Obtaining elements in the collection.

    Regarding,

    Ramganesh.

    Add comment
    10|10000 characters needed characters exceeded