on 02-08-2006 4:26 AM
Hi all,
i want to create a web Dynpro application which will fetch data from oracle database.
Can anyboby guide me with some documents.
Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks a lot.your answers were quite helpful to me.
Regards,
Sarika.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey sarika
Have you made it work yet? I had the same problem, and was using alot of my time trying to debug it. Then i came over a brilliant way to check if the datasource works. You can add your database connection in the Visual Administrator, and create an Alias. From webdynpro you just call on that alias when you want that datasource. Using this method allows you to type queries direct with telnetting j2ee server.
If you want, I can explain how? If you have not figure it out yet?
1) Open SAMMMC
2) Open the Process Table on SAPMMC
3) Right click on J2EE dispatcher and choose J2EE Telnet
4) Log in
5) Type "lsc" to see all the nodes in the cluster
6) Type jump <ID to the servernode> i.e: jump 1337754150
7) Type add dbpool
😎 Now you can use the command TEST_DS to test the datasource
Test your datasource with test_ds <dataource> <sql query>
i.e test_ds mySource Select * from myTable
if you get a result and no errors, your datasource should be correct.
If not, then log into VA and check your datasource properties. i.e maybe the vendor is not set correct...
Hope you figure it out.. If not, you now where the error is
Hi Sarika,
Create Development component.
In your component controller of WebDynpro Component add your database related code.like getting connection,registering connection etc.
This approach is much like all java applications connecting with oracle.
It wont be a big deal.Start your sample application.
If you need more info let me know.
Regards,
Karthick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Sarika
What does your connection look like?
Have you added your connection in Visual Administrator like i told you and created an alias?
If so, you can write this in your code:
InitialContext ctx = new InitialContext();
javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup("jdbc/<yourAliasFromVA");
java.sql.Connection con = ds.getConnection();
java.sql.Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM myTalbe");
I hope this helps you out!
Hi Sarika,
This document might help you:
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/how to install and configure external drivers for jdbc and jms adapters.doc
Regards,
Satyajit.
Thanks for your quick reply!
I am trying in another way.I've created a WD application and in custom controller I've put the code for connection, copying the retrived data into context and trying to display the data in one view.
CODE:
DriverManager.registerDriver(
new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection( "jdbc:oracle:thin:@oracle server ip:port:sid",
"user name",
"password");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("select * from table");
if (rs != null)
{
while ( rs.next() )
{
//code for copying data into context
}
}
stmt.close();
conn.close();
Error(No class defination found) is at first line i.e. new oracle.jdbc.driver.OracleDriver().
I've put classes.zip in lib and build path as well.
Regards,
Sarika.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.