cancel
Showing results for 
Search instead for 
Did you mean: 

Database Access with JspDynpage

Former Member
0 Kudos

Hi,

I want to know if it ist possible to access the WAS Database over JspDynpage.

If yes, can someone post me a tutorial or the way how to do that?

Thanks and Regards,

Dennis

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Dennis,

U can create a connection and do datasource lookup and access the database.

InitialContext contx = new InitialContext();

DataSource datasource = (DataSource)contx.lookup("jdbc/SAP<SID>DB");

Connection connection = datasource.getConnection();

Statement stmt = connection.createStatement();

ResultSet rs = stmt.executeQuery("Select * from table");

Also refer to this link for another example.

http://help.sap.com/saphelp_nw2004s/helpdata/en/fe/68e343cc68414da4426258d3e896ae/content.htm

Regards,

Harini S

Former Member
0 Kudos

Hi Harini,

thank you for your hints.

I will test the database connection soon. That was what I have searched for.

Regards,

Dennis

PS: Im right now not able to give rewardpoints. There is something wrong with the sdn.

I will give them to you if its possible again.

Answers (0)