sharma.raj411 0 Newbie Poster

hi every1

i m able to print the first record of the database on the page.
but i m not able to go to next record which i want to show on click of a button.
i dont want to use while(rs.next) as i dont want to show all the records at once.what i want is to show the new record at the same place where the old record was,i.e. when the next button is clicked i want the old record to disappear and new record be displayed at its place.

the code i m writing is->

<%@ page import="java.sql.*" %>
<htmL>
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String dataSourceName="mydsn";
String dbURL="jdbc:odbc:" + dataSourceName;
Connection con= DriverManager.getConnection(dbURL,"","");
Statement s=con.createStatement();
s.execute("select * from web");
ResultSet rs;
rs=s.getResultSet() ;
rs.next();
%>
<body>
<script>
function getDetails()
{
rs.next()
}
</script>
<form method="post">
Website:<input type="text" value="<%=rs.getString(1) %>"><br>
<a rel="nofollow" href="http://www.daniweb.com/techtalkforums/<input" target="_blank">Url:<input</a> type="text" value="<%=rs.getString(2) %>"><br>
Category: <input type="text" value="<%=rs.getString(3) %>"><br>
Description: <input type="text" value="<%=rs.getString(4) %>"><br>
Search Engine-><br>
Yahoo: <input type="text" value="<%=rs.getString(5) %>"><br>
Google: <input type="text" value="<%=rs.getString(6) %>"><br>
Altavista: <input type="text" value="<%=rs.getString(7) %>"><br>
<input type="button" value="Next" onClick="getDetails()">
</form>
</body>
</html>