cancel
Showing results for 
Search instead for 
Did you mean: 

Best practices: ext. database access

Former Member
0 Kudos

I've been tasked with using WebDynpro to create a sample report that extracts data from an external database (Oracle). Note that this external data source has absolutely nothing to do with SAP.

I currently have no idea how large the dataset it, but I'm curious how best to develop this with WebDynpro and the table view. I therefore have some (probably pretty basic) questions:

I suspect that I should use entity beans to implement the data layer - is this correct, or is there another way? note that I'm thinking long term, so I'm not looking for a quick-win (JDBC code embedded in the Dynpro component). For the reporting piece, access would obviously be read-only.

How do you handle large data sets? Say I have a table of a million rows - is there a 'built-in' way of scrolling over this dataset with a window of say 50 records? I could pre-load the context with all the data, but for large data sets this would not be possible.

Instead of using an EJB as the direct data-layer interface, how about exposing the EJB via a web service. Then I could query the web service, and restrict the number of rows fetched that way.

Any suggestions folks have would be most welcome. I'm a newbie to WebDynpro and J2EE development, and as such I'm kind of floundering in the large pool of documentation. Any sort of direction would certainly be helpful.

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi ken

You could display all the records using a Table UI element of WebDynpro. Pagination is automatic if you use this.

Regarding your database access you should write it as a separate entity bean or expose EJB as a webservice.These are known as models in WebDynpro.

A model enables the user to access business data that is outside the Web Dynpro application from within the application.

You have some predfined models and one of them is a WebService model.You could use this.

If there is anything else let me know.

regards

ravi

Former Member
0 Kudos

Thanks Ravi, that does help.

Since this application is really just a read-only demonstration app, I was planning on using sqlj in a stateless session bean. I would then use the bean in the model, right?

However, I think there's another problem with this 'solution' - the database I want to access is not the J2EE database, and I don't think I can access a 'external' database using sqlj - it seems that sqlj wants to validate the sql against the local (in this case MaxDB) database.

All the diagrams from the sqlj documentation point only at the j2ee database, and not an external database. If this is the case, am I left with writing plain JDBC against a datasource I define in the J2EE engine?

Also, does it matter where you define you data source? We're running EP, so I suppose it could be defined as a 'System', and you could access it via the Portal runtime - but could you not also define it as a J2EE datasource, and access it via InitialContext(), right?

These are all thought experiments right now, as I'm waiting for a hardware upgrade to get NW installed on my desktop for development purposes......I should hopefully be able to dig into these issues starting next week, once I have enough resources to run NW!

Thanks!

Former Member
0 Kudos

I'd appreciate any comments anyone might have on my previous post. Thanks.

Answers (0)