cancel
Showing results for 
Search instead for 
Did you mean: 

Access existing table

Former Member
0 Kudos

Hi all,

I am very new to WD development, I am trying to create a WD project which will:

- Accept some parameter

- Read data from a 3rd party database (i.e. Not the SAP system database)

- Display the result

I created the dataSource to the 3rd party database at VA, created a new J2EE DC, and created a entity bean, and trying to map the entity bean to the table.

I get stuck while I try to create the table in the dictionary:

1) It seem that the tables created in the dictionary will create in the DB when deploy, but I am using existing tables

2) I am not sure how the tables in the dictionary relate to the database (I find datasource at EJB side, maybe that's the relation?)

I understand the question is kind of stupid, any pointer for me to study will be more then welcome.

Thanks in advance

Regards

Bill

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Bill,

You can use EJBs or Web services to manipulate (insert/update/delete) the database tables created in java dictionary.

Please go though the following links.

1) )

2) http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b030e7fb-2662-2b10-0dab-c4aa52c35...? QuickLink=index&overridelayout=true

3) http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/80a30ef0-8d5d-2910-e987-cc8e49... [original link is broken]

4) http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/1f5f3366-0401-0010-d6b0-e85a49e93...

Regards,

Radhika

Former Member
0 Kudos

Hi Radhika,

Thanks for the reply, this give me some info on the WD development.

But in my case, I am difference from normal development that I am trying to use existing tables (existing table, multi-table for one result, sure read only), but not trying to create some new tables for use.

So, I would like to know what should I do because all the resources I find assume I will create a new table to use.

And I find nothing seem to allow me to choice existing table

Regards

Bill

Former Member
0 Kudos

Hi Bill,

Let us assume that the existing table is in oracle database (as you said u want to access non-sap database).

If you need not create a new table, then you can use only the EJBs (Entity Bean to access the database table), no need to have java dictionary.

You can refer to the following links. These posts tell about how to use web dynpro java with EJBs to access database tables.

Regards,

Radhika

Edited by: Radhika Parag Rajopadhye on Sep 22, 2010 6:10 AM

Former Member
0 Kudos

You can also set up a jdbc data source and then connect via jdbc as on any other j2EE server.

Former Member
0 Kudos

Hi Radhika,

Thanks for the helpful reply again, but too bad I am stuck when create the entity bean

Let me explain more details here, as far as I know, when I develop entity bean I need to

1) Link up the bean with a table definition in the data dict

2) Create the persistent fields

3) Use EJB QL statement to define query

So, my problem is (relate to the points above):

1) It is a existing table, did I still need to create a table def in data dict? It seem not possible because it will modify the database table, and I don't want this happen

2) without the data dict it seem somewhat pointless to create the fields here

3) It seem that EJB QL need data dict...

Here is what I guess after I done some reading (relate to the points above), please let me know if I am wrong:

1) I don't need to define the table, I can just let the setting empty

2) I will need to define the fields, if not the entity bean is useless and cannot use in WD

3) I can use vendor SQL, but I must make the entity bean read only

BTW, I tried to assign some points to you, please let me know if that did not work, am petty new here.

Regards

Bill

Former Member
0 Kudos

Hi Ilan,

Do you have any reference about that, am petty new here, have no idea how that can be done.

Regards

Bill

Former Member
0 Kudos

Hi Bill,

As per you requirement, you need to access existing table in non-sap database. So, you can use JDBC to do the same. Because using EJBs becomes quite complicated at times.

Please refer to the following wiki:

http://wiki.sdn.sap.com/wiki/display/WDJava/WebDynproApplciationwithDatabaseMS+Access

Regards,

Radhika

Former Member
0 Kudos

Hi Radhika,

Thanks for the reply.

Good to know that EJB is not the way to go so I don't need to spend any more time on it.

Tried the JDBC solution and it worked, thanks!

Regards

Bill

Answers (1)

Answers (1)

junwu
Active Contributor
0 Kudos

Hi,

if your ejb is ready, you can import the ejb as model, which can be consumed without any coding(code generated with wizard).

what's the version of your environment? server, ide..

Best regards,

John

Former Member
0 Kudos

Hi John,

Thanks for the reply.

I don't have a EJB yet, as I state in my last message, I am on the way to create one and stuck while I try to map to the table.

Regards

Bill