i wrote the following
jsp code to browse my records ..
<%@ page language="java" import="java.sql.*,java.io.*,java.util.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Faculty- Dept. Of Mech. Engg.-Home Page</title>
</head>
<body>
<div align="center"><b><font face="Georgia, Times New Roman, Times, serif">Display
Records</font></b>
<%
Connection con=null;
java.sql.Statement stmt=null;
ResultSet rs=null;
boolean y=false;
int i;
String username=(String)session.getAttribute("y");
out.print("<h4><pre>");
out.print("<font face=Georgia color=green>");
out.print("From \t Year \t To \t Year \t Semester");
out.print("Program\tCourse\tCourseNo\t Course Title\tLoadTaken\n</font>");
out.print("</h4>");
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc

dbc:mech_iit");
stmt=con.createStatement();
rs=stmt.executeQuery("select * from teaching_load where user_login='"+username+"' order by from_month desc");
while(rs.next()) {
out.print(rs.getObject(2).toString());
out.print(rs.getObject(3).toString());
out.print(rs.getObject(4).toString());
out.print(rs.getObject(5).toString());
out.print(rs.getObject(7).toString());
out.print(rs.getObject(8).toString());
out.print(rs.getObject(9).toString());
}
}
catch(Exception e)
{
System.out.println("exception in block"+e);
}
rs.close();
con.close();
%>
</div>
</BODY></HTML>
Iam getting a problem in displaying my output properly..
The column names of the tables are displayed but iam not getting the records in the right order..that is under each column name..the records are being displayed widely apart from each other..
any idea of the html tags to be used in the while loop that i have used..
thanks..