cancel
Showing results for 
Search instead for 
Did you mean: 

accessing oracle with web dynpro

Former Member
0 Kudos

Hey people!

I want to access a simple sql query on an oracle database and write the output in web dynpro.. Do i have to make an ejb for that? an how do i do that? or is it an easier way?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Kristoffer,

It's not necessary to have an ejb. It's possible to write your sql query directly in web dynpro code.

But, of course, in more complicated cases it's better to separate your UI and business logic.

Andrei Smolkin

EPAM Systems

<a href="http://www.netweaverteam.com/">http://www.netweaverteam.com/</a>

Former Member
0 Kudos

Thanx Andrei!

You got any examples to do so?

All i find involves EJB...

Former Member
0 Kudos

Kristoffer,

You can take any simple example of using web dynpro and replace test data with data from your sql query.

For example, you can get it from Net Weaver IDE "...\eclipse\examples\WebDynpro_Table.zip" and change method "createBasket( )". In this method you can directly connect to the DB and apply your data to the web dynpro node instead test data defined in this application.

Andrei Smolkin

EPAM Systems

<a href="http://www.netweaverteam.com/">http://www.netweaverteam.com/</a>

Former Member
0 Kudos

I have managed to connect to my database now..

if someone else have the same problem then here is what i did:

1) make a datasource in VA

2) set up a connection in your dynpro code:

InitialContext ctx = new InitialContext();

javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup("jdbc/YourAlias");

java.sql.Connection con = ds.getConnection();

java.sql.Statement stmt = con.createStatement();

rs = stmt.executeQuery("SELECT * from table");

3) run true your recordset and get the values

eg. rs.getString(1)

Former Member
0 Kudos

hi

i am working on example where i have to save from an application in wedynpro to

oracle database , can u help me in this issue,ihave already created application

and how to proceed next ,please help if possible

Answers (0)