cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing database using EJBs in WebDynpro

Former Member
0 Kudos

Im using EJBs to access database...data is getting stored in the database...but i dnt know how to retrieve it...webDynpro is a totally new environment for me..it would be a great help if someone can help me solve my problem...

regards,

Sonal

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

- start with "import JavaBean model" (importing model)

- put model in Used Models

- bind model with controller (web dynpro components-> double click on <application name>

- bind view with controller (same vindow)

- apply template (table for reading data) in view

and you are redy for start.

Eq

your EJB is MyEJB, and there is some function myFunction() with Vector as return (Vector contains MyEJB objects)

now in controller put (eq in wdDoInit())

MyEJB myObject = new MyEJB()

wdContext.current<NodeName>.bind(myObject.myFunction());

good luck

Former Member
0 Kudos

Hi Vedran,

Thanks for ur reply...i implemented as u suggested but there is some problem...its not displaying the data..Please can u explain it in detail or if possible give an eg..Please its very urgent..

Thanks and Regards,

Sonal

Former Member
0 Kudos

Hi Sonal,

you must detect where is error.

if myObject.myFunction() return Vector with size 0 there is problem in Bean,

if the function is OK, probably is problem with binding (model-controller or controller-view)

try use debuging mode and find where is error

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

I suppose this could also help you.

Sreenivas.

Former Member
0 Kudos

Hi Sonal,

Well you can go through the follwing tutorial about using EJBs in WebDynpros. It also gives you an idea of you can store data in database tables.

Its a simple calculator Web application.The calculated bonus must also be recorded in a database table : Ejbs in WebDynpros PDF

or the details of the complete tutorial with a readymade project is also available at sdn webdynpro tutorials :

EJBs in WebDynPros

And you can find many more WebDynPro tutorials under :

SDN WebDynPro Tutorials

Hope this helps you.

Sreenivas.

Former Member
0 Kudos

Hi Sonal ,

See the code

It explains everything that you need to do to connect to oracle

Regards

Rohit

Message was edited by: Rohit Radhakrishnan