Skip to Content
avatar image
Former Member

Oracle - Webdynpro Tables

hi experts,

How to Store and fetch the data from oracle BD and after fetching i want to display that result in webdynpro table and storing is also from webdynpro view interface.

can anybody help me on end to end procdure how can i achive.

Advance Thank you,

-


vijai

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Aug 17, 2007 at 05:44 AM

    Hi Vijay,

    U can do it using webservices.

    create a webservice which will interact with oracle

    sample" target="_blank">https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/28113de9-0601-0010-71a3-c87806865f26?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d">sample [original link is broken] [original link is broken]

    create webservice model for that webservice

    use that model in ur webdynpro application.

    In the following link u can find everything in Backend Access/ Model section.Accessing the car rental webservice & using ejb's in webdynpro will be helpful.Can rental webservice step by step is available on help.sap.com.

    regards

    Sumit

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 17, 2007 at 05:45 AM

    Hi vijay,

    <b> using EJB and connect with oracle.</b>

    the step by step procedure is follow how to connect with oracle

    1) Open the J2EE perspective

    2) Create an EJB Module project

    3) Right click on ejbModule, create a new EJB (select your EJB type)

    4) While creating the ejb itself, you can add business methods by clicking ‘Next’ in the UI. Another option is after creating the ejb, write the method in the bean, then select the method from ejb-jar.xml -> <bean name> ->method. Right click and select ‘propogate to local & remote’.

    5) Double click on ejb-j2ee-engine.xml. select your bean and specify a Jndi name for eg: “MyJndi”.

    6) Right click on the EJB project and add ‘classes12.zip’ file (provided by Oracle) to it’s build path. (under libraries tab). Also check the same file under ‘Order & Export’.

    7) Create an Enterprise Application project.

    8) Right click on the EJB module project and select add to EAR project, then select the created EAR project.

    9) Right click on the EJB project, select ‘Build EJB Archive’

    10) Right click on the EAR project, select ‘Build Application Archive’

    11) Open the WebDynpro perspective, open a new project, right click on the project ->properties. Do the following configurations :-

    • Java Build path - select the EJB project from ‘projects’ , check the selected project under ‘Order & Export’

    • Project references – select the EAR project

    • WebDynpro references – select ‘sharing references’ tab, click add & make an entry as : <vendor>/<EAR project name without .ear extension>

    You can find the vendor name under ‘application-j2ee-engine.xml’ file of the EAR project. By default it is ‘sap.com’. So if my EAR project’s name is ABC, my entry would look like ‘sap.com/ABC’

    12) Now the configurations are over and the EJB can be invoked by writing the client code inside the webdynpro component. Like:

    InitialContext context = new InitialContext();

    Object obj = context.lookup("MyJndi");

    MyEJBHome home = MyEJBHome)PortableRemoteObject.narrow(obj,MyEJBHome.class);

    MyEJB mybean = home.create();

    int a = 0;

    a= mybean.add(10,15);

    wdContext.currentContextElement().setSum(a);

    where ‘MyEJB’ is my EJB name and ‘MyJndi’ is my JNDI name

    To connect to Oracle , you can write the usual Java code (given below) as a business methos of the ejb (similar to add() method in the example). And access it like mybean.<businessMethodName>().

    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

    Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@Oracle_server_ip:Oracle port:SID of the Database","user_name","password");

    Statement stmt = conn.createStatement();

    ResultSet rs = stmt.executeQuery("your query");

    i hope that the above steps are useful for u.

    Regards,

    P.Manivannan.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Vijay,

      U need a model anyhow in webdynpro if u want to interact with backend.For model u need either webservice ,RFC u can't use bcos that's for r/3,or java bean model. now that depends on u what u want to use.

      If u still have confusion,i will suggest u to study MVC architecture again

      regards

      Sumit

      Message was edited by:

      Sumit Malhotra

  • avatar image
    Former Member
    Aug 17, 2007 at 06:52 AM

    Hi Vijay,

    please refer to the following link,

    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d

    There is lot of sample tutorial is ther. please go through first regarding ur requirement

    Regards,

    P.Manivannan

    Add comment
    10|10000 characters needed characters exceeded