Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Database Access with JspDynpage

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

Former Member
Former Member replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question