I'm trying to generate an html page with incoming emails for the user.
The problem is that without errors my program suddenly stops the generation of the page after generating some stuff.
here is a snip of this part of code that i have the problem:
for (int i=0, n=message.length; i<n; i++) { if(crudAction.equals("init")) is_new = es.checkIfIsNew(currentUser.getUser().getId(),folder.getUID(message[i]),message[i]); if(is_new){ Statement stmt = db_con.createStatement(); SimpleDateFormat dateFormat,db_dateFormat; dateFormat = new SimpleDateFormat("EEE d/MM/yyyy HH:mm:ss a") ; db_dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); String received_date,db_received_date; received_date = dateFormat.format(es.getReceivedDate(message[i])); db_received_date = db_dateFormat.format(es.getReceivedDate(message[i])); String UID = folder.getUID(message[i]); //getting the client with that incoming message email get_client_pstmt.setString(1,message[i].getFrom()[0].toString()); ResultSet rs = get_client_pstmt.executeQuery(); if(rs.next()){ client_id = rs.getString("ID"); client_name = rs.getString("SURNAME") + " " + rs.getString("NAME"); }else{ client_id = "Uνknown"; client_name = message[i].getFrom()[0].toString(); } System.out.println(i + ": " + message[i].getFrom()[0] + "\t" + message[i].getSubject()); if (i%2!=0) { %> <tr class='vnetLineOdd'> <% } else { %> <tr class='vnetLineEven'> <% } %> <td align="center"><input type="checkbox" class="email_rec" name="msg_<%=i %>" value="<%=UID %>"/></td> <td <%=msg_seen %>><%=i+1 %></td> <td><input type="button" class="vnetTabSelect" onclick="msg_num.value='<%=UID %>';crudAction.value='show_msg';target='_blank';this.form.submit();" value="Open"/></td>////Stops here..This line is generating 5 time insteed of 7; <td <%=msg_seen %>><%=client_id %></td> <td <%=msg_seen %>><%=client_name %></td> <td <%=msg_seen %>><%=message[i].getSubject() %></td> <td <%=msg_seen %>><%=received_date%></td> <td <%=msg_seen %>><%=message[i].getSize()/8 %>KB</td> </tr> <% rs.close(); } }
After printing some results it's just stops in the line i comment in my code.
Any ideas why is this happening??
Thanks in advance..