1.I have a format required to be displayed in jsp. Where the rows should be displayed row wise.
2.These values(numbers) are dynamic i.e if the data is present in database i will get values else 0 will be got
3.The values are retrieved from database using ArrayList Concept
4.Data should be displayed in table format .
I have a format but not able to post it as image please let me know how can upload the format.
AAAA BBBBB CCCCCC
A 3 4 0
B 43 3 2
C 0 3 3
enter code here
Connection con=null;
Statement st= null;
PreparedStatement pstmt=null;
ResultSet x=null;
String s1="";
String age="";
String s="";
String tot="";
%>
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:sup_sup","scott","tiger");
st=con.createStatement();
x=st.executeQuery("SELECT name,COUNT(age) ,COUNT(*) - COUNT(age) ,COUNT(*) FROM supreeth_table GROUP BY name");
%>
");
out.println("NAME");
while(x.next())
{
out.println(""+x.getString(1)+"" );
}
out.println("");
out.println("");
out.println("NAMESS");
while(x.next())
{
out.println(""+x.getString(2)+"" );
}
out.println("");
out.println("N");
out.println("");
out.println("A");
out.println("");
out.println("NA");
%>
this is what the best could put up . Sorry with formatting I'm new to this
these data should be got from database in the same format. using arraylist,jsp.
Now i have tried to put the code i was trying pls help me out with answers Thank you in advance !!!