Try this
<%@ page import="java.net.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.sql.*" %>
<html>
<head>
<title>Untitled</title>
</head>
<body>
<%
Vector mail = new Vector();
try{
Class.forName("com.mysql.jdbc.Driver");
}
catch (Exception E) {
out.println("Unable to load driver.");
E.printStackTrace();
}
try{
Connection C = DriverManager.getConnection("jdbc:mysql://localhost/attendance","root","");
%>
<div align="center"><font size="+6">Student BarList</font><br>
In this page will display out the student that attendance NOT MORE THAN 70%. The Student Below is NOT ALLOW to take exam for the relevant subject.
The student whoever not satisfy with the bar can negotiate with the lecturer of the relevant subject.<p/>
The student below will be bar from the relevent subject:<br/>
<%
Statement S = C.createStatement();
ResultSet rs = S.executeQuery("SELECT * FROM bar");
ResultSetMetaData rsStruc = rs.getMetaData();
out.println("<table bgcolor=red cellpadding=10 cellspacing=1 size=70>");
out.println("<tr bgcolor=red>");
int colCount = rsStruc.getColumnCount();
String colName = "";
for(int i=1;i <= colCount; i++){
colName = rsStruc.getColumnName(i) ;
out.println("<td><B><font color=white>" + colName + "</font></b></td>\n");
}
out.println("</tr>");
while (rs.next()) {
String email=rs.getString("email");
mail.addElement(email);
out.println("<tr bgcolor='ffffff'>");
for(int i=1;i <= colCount; i++){
colName = rsStruc.getColumnName(i) ;
String fld = rs.getString(colName);
out.println("<td>" + fld + "</td>");
}
out.println("</tr>");
}
out.println("</table>");
rs.close();
C.close();}
catch (Exception E) {
out.println("SQLException: " + E.getMessage());
}
String add = "";
for(int i=0; i< mail.size(); i++){
add = mail.elementAt(i)+",";
out.println(add);
}
%>
<form action="simplemail.jsp" method="post">
<input type="text" name="address" value="<%=add%>">
<input type="submit" name="send" value="Send Mail">
</body>
</html>