cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding getting data from Oracle Database

Former Member
0 Kudos

Dear Experts

Requirement:I want to develop an appl,but this app needs to be get the data from Oracle(10g) database.

Plz give me the procedure for that.

Thanks

Hazrath.G

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Plz check blog:

(Using other Database)

Answers (1)

Answers (1)

Former Member
0 Kudos

Still the problem was not solved

Edited by: Hazrath on Mar 6, 2008 12:01 PM

Former Member
0 Kudos

Hi hazarth,

using EJB you can get the data from oracle database.

Do the following steps and get the data from EJB to webDynpro

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.

😎 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:

Context initialContext = new InitialContext();

InitialContext ctx = new InitialContext();

String lookupString ="sap.com/ABC’";

Object obj = ctx.lookup(lookupString);

GradeAnalysisQueryDataHome ejbHome =( GradeAnalysisQueryDataHome) javax.rmi.PortableRemoteObject.narrow(obj,GradeAnalysisQueryDataHome.class);

GradeAnalysisQueryData simpleEJB = ejbHome.create();

where

---ABC means the name of the ear file under comes up in the Enterprise Application

---GradeAnalysisQueryDataHome means the name of the home interface

..

if u using oracle database import into the class12.jar file..

thats all..

Regards,

P.Manivannan