
hai sir , i have written the same code for the display but the data was displaying in the server but not on the jsp page pleas help me. thanks for ur answere
please help me soon

Hi Friend,
How this can be possible? The code we have given stores the values in the table and table is a tag. so it must be displayed on the page.
<%@page import="java.sql.*"%>
<table border=1>
<tr><th>Name</th><th>Address</th></tr>
<%
try{
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select * from data");
while(rs.next()){
%>
<tr><td><%=rs.getString("name")%></td><td><%=rs.getString("address")%></td></tr>
<%
}
rs.close();
st.close();
con.close();
}
catch(Exception e){}
%>
</table>
Anyways, have u create a table 'data' in ur database 'test'.And which values are being displayed on the server. Let us know.
Thanks
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.