You're trying to directly mix a process across two different environments. It won't work like that.
That page executes twice as two different 'programs' so to speak. Firstly; it's a JSP? program; which is able to connect to your database (on a server) and to 'transform' the page somewhat. After the JSP process has run; your page will look something like this:
<html>
<body>
<script>
function getDetails()
{
rs.next()
}
</script>
<form method="post">
Website:<input type="text" value="example">
Url:<input type="text" value="http://example.com">
Category: <input type="text" value="generic">
Description: <input type="text" value="these values came from your database">
Search Engine->
Yahoo: <input type="text" value="is a search engine">
Google: <input type="text" value="owns the web">
Altavista: <input type="text" value="used to be more popular">
<input type="button" value="Next" onClick="getDetails()">
</form>
</body>
</html>
That page is sent to a web browser; where it is interpretted as an "HTML and Javascript" program. Clearly; there's no reference anywhere to the 'rs' object that you were using at the server; and even if there was; you wouldn't be able to keep a local connection to your database active on a remote machine.
The easiest way you can do what you want to do; is to send information to your server side script by whatever means; telling it which record to display. You could do that by reloading the page with a query string variable when the 'next' button is clicked; and then using that in the JSP program as a record index... Or using an AJAX method to send a request from a Javascript method (running in a user's browser) to a JSP program (running on the server) that replies with raw (indexed) record data; which can then be used to fill in the fields.
Or, if your recordset is always going to be quite small; you could use JSP to write the records into Javascript arrays; and then move through them when 'next' is clicked.
I think, you may get better assistance at the JSP forum . Personally, I have no way to run JSP code; so I can't give you particularly specific advice.