on 07-07-2005 11:00 PM
Hello everybody:
I have created the navigation view for an application, with all the fields and stuff. However, I do need Database access (it's some kind of a school management system) for normal things such as login, etc.
I've learned that for linking a WebDynpro app and database (model) EJB are the way to go. However I find it way to "square", after reading the "Car Rental" tutorial. I doesn't leave much room for changes and it requires the web service to be perfect and then be imported for my model... is there another way to link or to create a model?.... I don't want to "Import" the model, but create it.
Thanks everyone in advance
Alejandro
hi
if you are creating your table and other data stuffs in the abap side. you can connect to the R3 side and get data. try this link for help in doing that
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/cr... a web dynpro application accessing abap functions.pdf
and if you are using oracle you can use ejb and you can connect to it using the code below
InitialContext ic = new InitialContext();
Object obj = ic.lookup("localejbs/<Name of EJB project>/<Bean name>");
UrlEjbLocalHome home = (UrlEjbLocalHome)javax.rmi.PortableRemoteObject.narrow
(obj,UrlEjbLocalHome.class);
UrlEjbLocal ejbs = home.create();
//Write the following code as a function in your EJB and call it after the above given code using the object of type 'UrlEjbLocal' named 'ejbs'
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@<IPAdd>:<Port>:<DBName>",
<LoginId>,
<PassWd>);
hope this might help you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, thanks everyone for your help.
"You havent specified which database want to access, if its R/3 or Oracle?"
Actually that's the problem... I don't want to be "Tied" to any database, so I have created a set of java classes that encapsulate all SQL-DATABASE specific stuff and I've created an "entry point" and I manage all from there.
"tell how you want to access ur database, thru a java class. If yes, do it and refer this java project in your dynpro project and access those java classes there and bind it with UI thru contexts."
Yes, I'd like to do that.... however, there will be no model at all, will there? I mean the model encapsulation will be done by me in a .JAR file, and it will not appear in the diagrams.... I was tempted to do that, but the eyes of the Gang of four stared at me with an anger! 😃
I'll give a try to that DB->Model generator, I hope it helps..... just one more question, if I go for the Java classes and access those classes thru context, how can I embed my JAR into my EAR so I don't get the Class def not found exception? I mean to deploy the whole thing.
Thanks everyone, you've been very helpful.
Alejandro
Hi
You havent specified which database want to access, if its R/3 or Oracle?
If it is the R/3 database you want to access, then you can create Remote Function Modules (for manipulating the database) in SAP and import them to WebDynpro by creating a model.
Now, if it is the Oracle database, then you may create an EJB and write methods in it to connect to the database and to manipulate it.You may then refer this project from your WebDynpro project reference.
Revert back for further details
Regards
Leena
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Leon,
From ur question it seems that u are not inteterested using EJB and then web service Model as par your requirement.
tell how you want to access ur database, thru a java class. If yes, do it and refer this java project in your dynpro project and access those java classes there and bind it with UI thru contexts.
Rgds,
Vilish
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.