cancel
Showing results for 
Search instead for 
Did you mean: 

Database connection and display in JSP page

Former Member
0 Kudos

hi,

I am new to SAP netweaver. I have created a project using JSPDynPage, Beans and java file. I have configure the datasouce in Visual Composer. I deploy the project on the portal itself. I have try all kinds of codes bt cannot retrieve. Is there anyone can give a same codes for mi to connect to the datasource in Visual Composer and able to retrieve data, insert data and update data in SQL Server 2000. Thanks

Regards,

shixuan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

erm...i have try the codes in one of the website bt i have gt error in the codes...dey underlined wif red...is there anything else that need to be import before the codes can be use???

The codes are as follow:

InitialContext ctx = new InitialContext();

DataSource src = (DataSource) ctx.lookup("java:env/jdbc/test2");

Connection con = src.getConnection();

Statement st = con.createStatement();

ResultSet rs = st.executeQuery("select ApprasialYear from tblAppraisal");

while (rs.next()) {

response.write(rs.getString(1));

}

Please help mi.

thanks

Regards,

shixuan

Answers (3)

Answers (3)

praveenkumar_kadi
Active Contributor
0 Kudos

Hi,

Visit this link. check to see that you followed all the steps as defined here.

JDBC config in VA tool visit

http://help.sap.com/saphelp_nw04/helpdata/en/b0/6e62f30cbe9e44977c78dbdc7a6b27/frameset.htm

Screen shot of VA configuration for JDBC

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6209b52e-0401-0010-6a9f-d40ec3a0...

Hope that helps

praveenkumar_kadi
Active Contributor
0 Kudos
Former Member
0 Kudos

Hai Shixuan,

Refer this link. I will helps

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

Write this code wher you need in JSPDynPage

And

Thanks and Regards

Venkatesh

Message was edited by:

Venkatesh Ranganathan

Message was edited by:

Venkatesh Ranganathan