WebDynpro vs Oracle
Hello to all!
I am developing a simple component to bring data from a Oracle Database to a Web Dynpro tableView. My main doubt: Is it necessary to include in the EJB a method getConnection that returns a connection of the defined DataSource and other one that executes the query or is it enough having the table created in the Java Dictionary.
Greetings and thank you very much in advance.
Hi ,
Check with this sample and tutorial for backened
access.
https://www.sdn.sap.com/irj/sdn/developerareas/webdynpro?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d.
Read "Java Persistence" section in Development manual describing various options for database integration
http://help.sap.com/saphelp_nw04/helpdata/en/61/fdbc3d16f39e33e10000000a11405a/frameset.htm
Tutorials
http://help.sap.com/saphelp_nw04/helpdata/en/46/ddc4705e911f43a611840d8decb5f6/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/91/9c2226df76f64fa7783dcaa4534395/frameset.htm
Web serices
http://help.sap.com/saphelp_nw04/helpdata/en/d6/f9bc3d52f39d33e10000000a11405a/frameset.htm
EJB
http://help.sap.com/saphelp_nw04/helpdata/en/19/f9bc3d8af79633e10000000a11405a/frameset.htm
Regards,
Vijayakhanna Raman
Similar Messages
-
Error in connecting webdynpro with oracle
Hi
while connecting webdynpro with oracle, i am getting this type of error. I imported the classes12.jar file also.
<b>Error:</b>
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
The <b>coding</b> which i used to connect is as follows,
Class.forName("oracle.jdbc.driver.OracleDriver");
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection(
"jdbc:oracle:thin:@entegdt36:1521:dbserver",
"scott","tiger");
pst=conn.prepareStatement("select * from Test");
rs=pst.executeQuery();
while(rs.next())
res=res+rs.getString(1);
wdThis.wdGetContext().currentContextElement().setName(res);
Please help me to solve this problem.
It's very urgent.
Thanks in advance.Hi,
Go to technical landscapes and create a technical landscape for your ECC backend system.
This should solve the problem.
Regards
Bharathwaj. -
hi experts,
created one webdynpro application which connect to Oracle database, directly without webservices and ejbs.
my code is as follows:
Connection con = null;
Statement stmt = null;
DataSource ds=null;
ResultSet rs=null;
try
InitialContext x = new InitialContext();
ds = (DataSource)x.lookup("jdbc/datadb");
con = ds.getConnection();
stmt = con.createStatement();
rs = stmt.executeQuery("INSERT INTO APPLICANTDTLS1(APPLICANTID,APPFIRSTNAME,APPMIDDLENAME) VALUES ('1234','SSS','YYY') ");
catch(Exception e)
since there was no error , but when i see the database no record was inserted
so how can i find out where i want wrong.
could anyone help me on this issueHi Vijay,
Lets try to print messages from Catch block. Might be the connection threw some error.
try
InitialContext x = new InitialContext();
ds = (DataSource)x.lookup("jdbc/datadb");
con = ds.getConnection();
stmt = con.createStatement();
rs = stmt.executeQuery("INSERT INTO APPLICANTDTLS1(APPLICANTID,APPFIRSTNAME,APPMIDDLENAME) VALUES ('1234','SSS','YYY') ");
catch(Exception e)
wdComponentAPI.getMessageManager().reportException("INSIDE CATCH", true);
Regards,
Rekha Malavathu -
Hi,
I am evaluating the Webdynpro client for development. Is it possible to use Webdynpro to connect/retrieve data from an Oracle database.
Thank you.
NACHi NAC,
yes it is very well possible to fetch data from any database in WebDynpro.
For connecting to Oracle, either you can use the normal JDBC connectivty code directly which is given below :
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@Oracle_server_ip:Oracle port:SID of the Database","user_name","password");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("your query");
In case you want to fetch data through ejbs, these are the steps to be followed :
1) Open the J2EE perspective
2) Create an EJB Module project
3) Right click on ejbModule, create a new EJB (select your EJB type)
4) While creating the ejb itself, you can add business methods by clicking Next in the UI. Another option is after creating the ejb, write the method in the bean, then select the method from ejb-jar.xml -> <bean name> ->method. Right click and select propogate to local & remote.
5) Double click on ejb-j2ee-engine.xml. select your bean and specify a Jndi name for eg: MyJndi.
6) Right click on the EJB project and add classes12.zip file (provided by Oracle) to its build path. (under libraries tab). Also check the same file under Order & Export.
7) Create an Enterprise Application project.
8) Right click on the EJB module project and select add to EAR project, then select the created EAR project.
9) Right click on the EJB project, select Build EJB Archive
10) Right click on the EAR project, select Build Application Archive
11) Open the WebDynpro perspective, open a new project, right click on the project ->properties. Do the following configurations :-
Java Build path - select the EJB project from projects , check the selected project under Order & Export
Project references select the EAR project
WebDynpro references select sharing references tab, click add & make an entry as : <vendor>/<EAR project name without .ear extension>
You can find the vendor name under application-j2ee-engine.xml file of the EAR project. By default it is sap.com. So if my EAR projects name is ABC, my entry would look like sap.com/ABC
12) Now the configurations are over and the EJB can be invoked by writing the client code inside the webdynpro component. Like:
InitialContext context = new InitialContext();
Object obj = context.lookup("MyJndi");
MyEJBHome home = MyEJBHome)PortableRemoteObject.narrow(obj,MyEJBHome.class);
MyEJB mybean = home.create();
int a = 0;
a= mybean.add(10,15);
wdContext.currentContextElement().setSum(a);
where MyEJB is my EJB name and MyJndi is my JNDI name
To connect to Oracle , you can write the usual Java code (given below) as a business methos of the ejb (similar to add() method in the example). And access it like mybean.<businessMethodName>().
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@Oracle_server_ip:Oracle port:SID of the Database","user_name","password");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("your query");
Hope this helps,
Best Regards,
Nibu. -
WebDynpro and Oracle Connection
Hi all,
I have to Build a form in WebDynpro which talks to Oracle Database.I have gone through the forums suggesting that i have write a database connection code in Component Controller Context,But my application is throwing an SQL Exception(Oracle Class not Found).
I have imported ojdbc14.jar , classes11.jar, classes12.jar
But i still find an error in my application,Is that i have to code in a different Place or i have to do any configurations in J2ee Engine Server or i need to add any more JAR Files.
So plz suggest me Regarding this ASAP.
I Hope a write answer from the WebDynpro Experts.
I will reward you with the Points.
Thanks and Regards
Santosh SarafHi Santosh,
Did you go through Connection to an Oracle DB ? procedure is described pretty detailed there.
Best regards, Maksim Rashchynski. -
Why to Use EJB rather then Direct Connection To Oracle Thru webDynpro?
Hi
Experts,
I want to know that why to use EJB to connect to oracle rather then direct connection via WebDynpro.
Please Give Me References to how to connect to oracle with EJB or WebDynpro.I want to tell you that i know JDBC,JAVA and basic web Dynpro.
Please Reply Me Dear Friends...ASAP.EJB are better for a project beacuse the application is scalable, have less maintainence and have better performance.
Have you gone throght these:
Connect Oracle 9.2 DB to Web AS 6.40
web dynpro - database connection
web Dynpro application connecting to oracle
/people/ramesh.jandhyala/blog/2007/01/02/webdynpro-and-oracle-using-dtos
Regards,
Ashwani Kr Sharma -
Connecting Oracle DataBase through WebDynpro
Hi,
I created a Dynamic table, now I should display the data from Oracle Database. I tried in many various ways to connect to database, but the data is not retrieving.
Can u explain the reasons and give necessary coding to retrieve the data.
Its very very urgent.Hi
I think you can do using the APIs provided by SAP.
Check this link
JDBC Reference
or
Try connectinc using lookup.
try{
InitialContext ctx=new InitialContext();
javax.sql.DataSource ds=(javax.sql.DataSource)ctx.lookup("jdbc/SAPJ2EDB");
java.sql.Connection con=ds.getConnection();
java.sql.Statement stmt=con.createStatement();
con.close();
catch(Exception e)
wdComponentAPI.getMessageManager().reportException("Exception "+e,true);
Check this thread moreuseful.
WebDynpro and Oracle Connection
Please Check these threads
Re: I need a j2ee code for getting data from oracle database
Re: oracle connection
Re: problem with displaying records from the database in a table ui element
See this sample application and help
https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/f0b0e990-0201-0010-cc96-d7ecd2e51715
I hope these links will help u resolve your problem.
All The Best
Priyanka
Do Reward Points -
How to configure oracle to SAP NETWEAVER DEVELOPER STUDIO STEP RAGARDING
hi
can u help me on this
i got problem
regarding configuring oracle to sap NetWeaver developer studio what i have deployed any thing studio
that would reflected to database
byeHi,
Check this,
WebDynpro and Oracle Connection
WebDynpro and Oracle Connection
Regards,
Vijayakhanna Raman -
Problem in connecting to database from webdynpro for java
Hi
I have a problem in connecting to database from webdynpro application
I am using oracle 10 express edition as database and was able to connect to database from a java application.But was unable to connect from a webdynpro for java.
<b>I guess webdynpro for java uses open sql instead of vendor sql(I looked in the visual admin ,DB is using open sql) so unable to connect to database.Am i right.?</b>
Do i need to make any settings in the visual admin to make it work?
How to solve this problem.Please give me pointers
Thanks
BalaHi,
For connecting to Oracle, either you can use the normal JDBC connectivty code directly which is given below :
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@Oracle_server_ip:Oracle port:SID of the Database","user_name","password");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("your query");
In case you want to fetch data through ejbs, these are the steps to be followed :
1) Open the J2EE perspective
2) Create an EJB Module project
3) Right click on ejbModule, create a new EJB (select your EJB type)
4) While creating the ejb itself, you can add business methods by clicking Next in the UI. Another option is after creating the ejb, write the method in the bean, then select the method from ejb-jar.xml -> <bean name> ->method. Right click and select propogate to local & remote.
5) Double click on ejb-j2ee-engine.xml. select your bean and specify a Jndi name for eg: MyJndi.
6) Right click on the EJB project and add classes12.zip file (provided by Oracle) to its build path. (under libraries tab). Also check the same file under Order & Export.
7) Create an Enterprise Application project.
8) Right click on the EJB module project and select add to EAR project, then select the created EAR project.
9) Right click on the EJB project, select Build EJB Archive
10) Right click on the EAR project, select Build Application Archive
11) Open the WebDynpro perspective, open a new project, right click on the project ->properties. Do the following configurations :-
Java Build path - select the EJB project from projects , check the selected project under Order & Export
Project references select the EAR project
WebDynpro references select sharing references tab, click add & make an entry as : <vendor>/<EAR project name without .ear extension>
You can find the vendor name under application-j2ee-engine.xml file of the EAR project. By default it is sap.com. So if my EAR projects name is ABC, my entry would look like sap.com/ABC
12) Now the configurations are over and the EJB can be invoked by writing the client code inside the webdynpro component. Like:
InitialContext context = new InitialContext();
Object obj = context.lookup("MyJndi");
MyEJBHome home = MyEJBHome)PortableRemoteObject.narrow(obj,MyEJBHome.class);
MyEJB mybean = home.create();
int a = 0;
a= mybean.add(10,15);
wdContext.currentContextElement().setSum(a);
where MyEJB is my EJB name and MyJndi is my JNDI name
To connect to Oracle , you can write the usual Java code (given below) as a business methos of the ejb (similar to add() method in the example). And access it like mybean.<businessMethodName>().
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@Oracle_server_ip:Oracle port:SID of the Database","user_name","password");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("your query");
Extracted from Re: Webdynpro and Oracle
http://help.sap.com/saphelp_webas630/helpdata/en/b0/6e62f30cbe9e44977c78dbdc7a6b27/frameset.htm
May be of use to understand the VA Conf /people/varadharajan.krishnasamy/blog/2007/02/27/configuring-jdbc-connector-service-to-perform-database-lookups
Regards
Ayyapparaj -
Connectivity with oracle database using web Dynpro(for java)
Hi,
In web Dynpro we will connect to SAP systems by using Adaptive RFC. Then How to connect the oracle 8i/9i using webdynpro? Plese tell me the procedure to establish the connecting using enterprise portal?
Thanks & Regards,
Mastanvali ShaikHi,
Check these:
WebDynpro and Oracle using DTOs
https://wiki.sdn.sap.com/wiki/display/VC/JDBCConnectionSetup
Connecting Problum of SQL
Greetings,
Praveen Gudapati
[Points are welcome for helpful answers] -
Importing an EJB into WebDynpro
Hi all,
I am trying to import an existing stateless session bean into my webdynpro application.I have gone through the tutorials and other threads about bean model inthis forums.("https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/using ejbs in web dynpro applications.pdf")but is it necessary to have another access layer as bean importer to acces the ejb.Since creating another layer is not suggestible in my scenario, I have tried importing the bean directly, it says "no beans available".
Also I would like to know how can i bind those values returned by business methods of bean to the UI elements.
Please suggest favourably.
KSKHi,
You can directly call the methods in the bean without using bean model
see this thread
Webdynpro and Oracle
Regards
Rohit -
How to Populate values dynamically in Select Box.
Hi All,
I have few select boxes in my webdynpro application. Right now I am populating them using Harcoded values in the Dictionary. But I dont want to harcode the values in the dictionary, i want pull the values from database tables or text files of EP KM. Just let me know which is the better way to populate the select box without hardcoding & why ?
Thanks in Advance.
Regards,
Aditya MetukulHi Aditya,
Getting values from KM and database is possible
It depends on your requirement
ie if the dropdown should contain details of documents from KM or it should display the details in a table
if it is oracle table see this link
Webdynpro and Oracle
if you want to get data from km see this tutorial
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/tutorial on using knowledge management functions in web dynpro - 26.htm
Hope this helps you
Regards
Rohit
Regards
Rohit -
How much EJB I should to know?
Hi
Experts.
Hi i am making Guest house management system for a company in SAP netweaver and backend is oracle 10g.
i learned basics of sap webDynpro like
-->Navigation between views.
-->Context programming
-->Internationalization
-->Basic UI components like input field, table,.....
-->Dynamic programming.
Now to make this project efficient i have to know EJB to access database.
I don't know anything about EJB.
So how much EJB i need to know?
and what other things i need to know please provide good reference.
I am beginner in SAP webdynpro.
but I have good programming skills and learning skills.
Is there any good tutorials available for all this EJB and web dynoro connectivity?
and good tutorial with examples that teaches how to connect oracle and EJB?
and how to merge all this things?
Regards
Sunny Shah.Hi
Check thesse links they maybe helpful to you
Webdynpro and Oracle
Oracle DB connectivity using EJB.
http://help.sap.com/saphelp_nw04/helpdata/en/b5/3f533e5ff4d064e10000000a114084/frameset.htm
oracle connection
http://help.sap.com/saphelp_nw04s/helpdata/en/86/f8fdceffa642d08cd198da565dbbbe/frameset.htm
http://help.sap.com/saphelp_nw04s/helpdata/en/d3/44d0ea14539a4f9b8ec204cedee9bf/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/e0/a00e408230c442e10000000a1550b0/frameset.htm
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/0736159e-0301-0010-9ea4-c63d83d0797b
Regards
SURYA -
hi
i wanna connect to back end oracle database ,can any one send me steps
for creating datasource in visual admin tool and the code to be inserted in webdynpro and further things to be done
regards
RamakrishnaHi,
Yeah ofcourse you can connect to oracle from web dynpro. You need to have the 3 drivers of oracle for that. You then need to create the datasource with those drivers in Visula Admin of Oracle, and then you can access the oracle database from web dynpro, <b>In visual admin , under node server 0-> services-> JDBC connector</b>, you need to created new drivers with those 3 jars .
Once you have created the datasource with 3 drivers , you can access that in WD using datasource lookup,go through following some links,
web Dynpro application connecting to oracle
/people/ramesh.jandhyala/blog/2007/01/02/webdynpro-and-oracle-using-dtos
Web Dynpro Oracle
Oracle as Back-end with Web Dynpro
Accessing Oracle database using Web Dynpro application
accessing oracle with web dynpro
hope it helps
regards -
How to connect to data base in web dynpro development?
hi,
I am a green man in web dynpro development.I don't know how to create a connection to database in web dynpro development.I don't know wether we must create a DC to commit the mission.Hope to hear from you.Thank you!Hi ,
For information on this ,look at these loops.
Webdynpro and Oracle
Re: Oracle Packages
Re: BW connection to ORACLE
Re: WebDynpro vs Oracle
Regards,
Praveen
Maybe you are looking for
-
What is going on? iOS 5.1 cuts my iPhone 4's battery by half
I have my iPhone for a year now but as I am a light user, I have always been able to use my iPhone for 3 days on a single charge. Yesterday I updated to iOS5, my phone battery only last me 1.5 day. This is scary and it is obviously a software issue.
-
SQLPLUS Activity in Process Flow
Hi Im Trying to include a sql script thru Process flow using a SQLPLUS Activity In the Script, im giving the value as copy command(which im supposed to give) before that im giving the specifications as /oracle10/bin/sqlplus schema_name/password@DB fo
-
No Audio on some third party apps?
I just recently bought my iPad 2. I loaded most of my apps, music, movies onto the device as you would with any new toy. But now some third party apps do not have audio. I tried Angry Birds RIO HD, Angry Birds, etc. nothing. When I use Garageband and
-
Extension Manager 6.0.8 Update Installation failed. Error Code: U44M1P7
Paid Has anyone had a problem updating PS CS6? This is the error message I get: Extension Manager 6.0.8 Update Installation failed. Error Code: U44M1P
-
CC 2014.2 Crashes at file startup with Suitcase Fusion
Even with workaround of opening the file manually within Photoshop, CC 2014.2 continues to crash. The only way I've gotten around the issue is to manually activate my fonts then open the document. Is Adobe aware that the workaround is broken?