My resultset wont display
below is the coding for my webpage... the resultset wont display...
can anyone see why? i have a funny feeling ive missed a line of coding from the query...
<%
// +
// | LEARNING STYLE DATA QUERY
// +
boolean learningstyle =false;
boolean learningstyle2 =false;
String lstyleresult ="";
RS=Stmt.executeQuery("select data from learningstyle where userid='"+sr_studentid+"'");
if(learningstyle ==true)
{
//learningstyle = true;
PreparedStatement pStmt = ConnStar.prepareStatement("select data from learningstyle where userid='"+sr_studentid+"' order by submitted desc,id desc");
//pStmt.execute();
String data = RS.getString("data");
String[] arraydata = data.split(",");
String[] visualnos ={"4","6","8","12","13","17","22","24","25","29","33","35","37"};
String[] auditorynos ={"1","3","9","11","14","16","18","21","26","28","32","36","38"};
String[] doingnos ={"2","5","7","10","15","19","20","23","27","30","31","34","39"};
int vscore=0;
int ascore=0;
int kscore=0;
for (int i=0;i<visualnos.length;i++)
{
if(arraydata[Integer.parseInt(visualnos[i])-1].equals("Y"))
{
vscore++;
}
}
for (int i=0;i<auditorynos.length;i++)
{
if(arraydata[Integer.parseInt(auditorynos[i])-1].equals("Y"))
{
ascore++;
}
}
for (int i=0;i<doingnos.length;i++)
{
if(arraydata[Integer.parseInt(doingnos[i])-1].equals("Y"))
{
kscore++;
}
}
lstyleresult ="Visual: "+vscore+"/"+visualnos.length+"<br /><br />Audio: "+ascore+"/"+auditorynos.length+"<br /><br />Kinetic: "+kscore+"/"+doingnos.length;
}
elseif(learningstyle2 ==true)
{
//learningstyle2 = true;
PreparedStatement pStmt = ConnStar.prepareStatement("select data from learningstyle where userid='"+sr_studentid+"' order by submitted desc,id desc");
//pStmt.execute();
String data = RS.getString("data");
String[] arraydata = data.split(",");
String[] visualnos ={"1","2","3","4","5","6","7","8","9","10","11","12","13"};
String[] auditorynos ={"14","15","16","17","18","19","20","21","22","23","24","25","26"};
String[] doingnos ={"27","28","29","30","31","32","33","34","35","36","37","38","39"};
int vscore=0;
int ascore=0;
int kscore=0;
for (int i=0;i<visualnos.length;i++)
{
if(arraydata[Integer.parseInt(visualnos[i])-1].equals("Y"))
{
vscore++;
}
}
for (int i=0;i<auditorynos.length;i++)
{
if(arraydata[Integer.parseInt(auditorynos[i])-1].equals("Y"))
{
ascore++;
}
}
for (int i=0;i<doingnos.length;i++)
{
if(arraydata[Integer.parseInt(doingnos[i])-1].equals("Y"))
{
kscore++;
}
}
lstyleresult ="Visual: "+vscore+"/"+visualnos.length+"<br /><br />Audio: "+ascore+"/"+auditorynos.length+"<br /><br />Kinetic: "+kscore+"/"+doingnos.length;
}
else
{
learningstyle =false;
learningstyle2 =false;
}
%>
<div class="round-container round-orange-bg" style="float:right; width:385px;">
<div class="round-top-orange"><img src="../images/orange-tl.jpg" width="14" height="14" alt=" " class="corner" /></div>
<div class="round-title-bar">
<span class="round-title">Learning Style</span>
</div>
<table width="99%" cellpadding="4" cellspacing="0" border="0" style="padding-left:10px;">
<tr>
<%
if (learningstyle =true)
{
out.print("<th class='right'>Graph</th><td><a href='lstyle.jsp?studentid="+sr_studentid+"' target='_blank'>View learning style graph</a></td>");
}
elseif (learningstyle2 =true)
{
out.print("<th class='right'>Graph</th><td><a href='lstyle.jsp?studentid="+sr_studentid+"' target='_blank'>View learning style graph</a></td>");
}
else
{
out.print("<td class='center'>No graphical data recorded. <br /><strong><a href='/intranet/studentzone/learningstyles/' target='_blank'>Click Here</a></strong> to fill out the Learning Style Questionnaire</br></br><strong><a href ='lp_manual_update.jsp?studentid="+sr_studentid+"' onClick='return popup(this)'>Click here to enter score manually</a></strong></td>");
}
%>
</tr>
<%
if ((learningstyle ==true)||(learningstyle2 ==true)||(lstyleresult.length()>0))
{
%>
<tr>
<th valign="top" class="right">Score</th>
<td><%=lstyleresult%></td>
</tr>
<%
}
%>
</table>
<div class="round-bottom-orange"><img src="../images/orange-bl.jpg" width="14" height="14" alt=" " class="corner" /></div>
</div>

