on 08-17-2007 6:32 AM
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
Hi Vijay,
please refer to the following link,
There is lot of sample tutorial is ther. please go through first regarding ur requirement
Regards,
P.Manivannan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 its build path. (under libraries tab). Also check the same file under Order & Export.
7) Create an Enterprise Application project.
😎 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 projects 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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
Hi Vijay,
U can do it using webservices.
create a webservice which will interact with oracle
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi vijay,
Refer to this link also
http://help.sap.com/saphelp_nw70/helpdata/en/42/ef69b6aa5a1bc8e10000000a11466f/frameset.htm
step by step procedure availble in that link..
Regards,
P.Manivannan
Hi vijay,
Refer to this link also
http://help.sap.com/saphelp_nw70/helpdata/en/42/ef69b6aa5a1bc8e10000000a11466f/frameset.htm
step by step procedure availble in that link..
Regards,
P.Manivannan
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.