database & JSP
Hi everyone,
I am working with a database from SQL Server and a .jsp,
but, I can't pass the a value of the database to my program,
example:
<input type="hidden" name="price" value="19.95">
Float price =new Float(request.getParameter("price"));
In this case, I have this input type hidden with a value of 19.95,
then I do a request and get that value, that is worling ok,
But, if I want to get it from the database,
how do i do it?
here's how I declared the database code:
Connection connection = DriverManager.getConnection("jdbc:odbc:testDatabase","","");
Statement statement = connection.createStatement() ;
ResultSet resultset = statement.executeQuery("select price from pre3") ;
<TABLE BORDER="1">
<TR>
<TH>Name</TH>
</TR>
<%while(resultset.next()){ %>
<TR>
<TD>
<%= resultset.getString(1)%>
</TD>
</TR>
<%} %>
</TABLE>
the connection to the database is working fine, and gets printed as you can see, but, I don't how can I pass it to the Float price =new Float
what can I do to solve this?
thanks...

