cancel
Showing results for 
Search instead for 
Did you mean: 

EJB Web Dynpro - Data Persistence

Former Member
0 Kudos

What is the recommended way for connecting to oracle database and adding business logic to web dynpro application.?

We were researching on the CMP entity bean but found that CMP entity bean in SAP netweaver can be

configured only to connect to the default database. Its too difficult for my consious to digest why anyone will connect only to the default portal database. Is there any way that we could work on CMP entity beans and connect to an external datasource in EP 7.0 ?

Your valuable feedbacks would be highly appreciated...

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Dear Subash,

Find the thread, may help u.

REgards,

Sri

Former Member
0 Kudos

Sorry Srikanth...this doesnt answer my question.. I know we can connect to an oracle database using

the normal JDBC code in the session bean. Our actual concern is that in our WebDynpro application, we are trying to use CMP entity beans for database transactions. We are creating a dictionary project to define the tables to be used for entity beans. But Dictionary explorer is only supported for default database of the Portal.

We are trying to use an external oracle database as the data-source for entity beans. We would like to know whether this is possible in NWDS version 7.0.09.

Former Member
0 Kudos

Hi subash,

Go through it. you may get some inputs.

Regards,

Sri

Former Member
0 Kudos

Thanks Sri for trying to help me out.. But I think you didnt get my question right...

We very well know how to connect to an oracle database using JDBC in session bean.

The problem we faced was in CMP entity bean. In NWDS, we were able to create dictionary project and tables in the SAP Portal default database only. When we are trying to connect to another user in the same database or external database, NWDS has no options for it.

So we want to know what is the workaround for working in CMP entity beans and also connecting to an external database (not the default database)...?

Former Member
0 Kudos

Hi Subash,

I am not sure how you can connect the Developer Studio to a different DB schema than the system one, but regarding your application, you have to create a DataSource object for the specific database (schema) you want to use.

You can create the DataSource using the Visual Administrator, as described here:

http://help.sap.com/saphelp_nw70ehp1/helpdata/de/ab/082484173ae045ab8dad8a41d33da3/frameset.htm

Moreover, you have to configure your application to use that DataSource. This can be done by specifying the relevant elements in the persistent.xml file:

https://help.sap.com/saphelp_nw70ehp1/helpdata/en/e1/67fc3ee241ba28e10000000a114084/frameset.htm

I hope that helps.

Best,

Yordan

nitin_mahajan2
Contributor
0 Kudos

unlike others, I dont think it should be an issue in connecting to an external data base as long as you can telnet / ping to that db server from Portal.

All you need to create is a JDBC datasource from portal to that database and use that datasource in your application.

It should be pretty straight forward.

Did you try this?

The reason i know it should work is, i am working on MDM and from portal i create a datasource to connect to MDM database for one of the application provided by SAP and it is the standard procedure defined by SAP to create datasource and consume it.

I just saw, yardon has provided links to help.sap on how to create datasource, so you should be good.

Let me know if i need to explain more. I can guide you how to create datasource in Visual admin.

Good Luck

Regards,

Nitin

Edited by: Nitin Mahajan on May 1, 2009 6:50 PM

Edited by: Nitin Mahajan on May 1, 2009 6:50 PM