cancel
Showing results for 
Search instead for 
Did you mean: 

Connect to DB2 database via JNDI

Former Member
0 Kudos

I am currently using the evaluation copy of the NetWeaver SAP and would like to use the DB2 as back end. In order to connect to the database, a JDBC data source is created. But it is not clear how to connect to the JDBC DataSource from the J2EE application developed in Net Weaver.

This question was also raised by Saumya Dutta Gupta on 23d Nov - but no answers! Come on guys SOMEBODY out there should be able to help us!

Thanks in advance!

Accepted Solutions (0)

Answers (1)

Answers (1)

Vlado
Advisor
Advisor
0 Kudos

Hi Ashley,

There are a lot of comprehensive manuals on http://help.sap.com. In your case you could start with <a href="http://help.sap.com/saphelp_nw04/helpdata/en/82/fdbf2085f65f43a71e755fc904478d/frameset.htm">this</a> one.

Best regards,

Vladimir

Former Member
0 Kudos

Thats great - thanks. I had looked in help.sap.com, but I guess I didn't search using the right keywords!

Former Member
0 Kudos

HI Ashley,

FOr connecting with the DB try out this following code:

InitialContext ctx=new InitialContext();

DataSource ds=(DataSource)ctx.lookup("jdbc/<db alias name>");

Connection con=ds.getConnection();

THis may workout.

Regards,

Rathna.