Q:

Add value from database to a dropdownlist

How to do one ? 
I'm doing this but I'm stuck on the beginning.
I know that I have to do this.
  <strong>Select a product :</strong>
                <select name="stock_name">
           <c:forEach var="row" items="${Stocks.rowsByIndex}">
            <c:forEach var="column" items="${row}">
                <option value="<c:out value="${column}"/>"><c:out value="${column}"/></option>
            </c:forEach>
        </c:forEach>
                </select>

but then If I do like this I have nothing inside. This is put inside a .html. I know I have to put
<sql:query var="stocks" dataSource="healthds">
              SELECT stockid FROM Stocks
            </sql:query>`

Where should i put the query ? In a jsp ?? and how to connect them ? I really cant get it.
This is the full form
 <form method="post" action="PurchaseCreate">

        <p>Please enter the fields below to make your purchase</p>
        <sql:query var="stocks" dataSource="healthds">
          SELECT stockid FROM Stocks
        </sql:query>
        <strong>Select a product :</strong>
            <select name="stock_name">
       <c:forEach var="row" items="${Stocks.rowsByIndex}">
        <c:forEach var="column" items="${row}">
            <option value="<c:out value="${column}"/>"><c:out value="${column}"/></option>
        </c:forEach>
    </c:forEach>
            </select>
        </p>
        <p>Quantity :
            <input type="text" name="quantity">&nbsp;
        </p>
            <input type="submit" name="create" class ="button" value="Add into cart">

    </form> 

EDIT:
Main.jsp
<%@ taglib prefix = "c" uri = "http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>

<html>
<head>
<title>Test Tags</title>
</head>
<body>
<h1>Reading Data</h1>

  <sql:query var="stocks" dataSource="healthds">
       SELECT stockid FROM Stocks
  </sql:query>

<form method="post" action="Main.jsp">
    <p>Please enter the fields below to make your purchase</p>
    <strong>Select a product :</strong>
    <select name="stock_name">
     <c:forEach var="i" begin="1" end="5">
       <option>Item <c:out value="${i}"/></option>
     </c:forEach>
     <c:forEach var="row" items="${stocks.rowsByIndex}">
      <option><c:out value="${row[0]}"/></option>
     </c:forEach>
    </select>
    </p>
    <p>Quantity :
        <input type="text" name="quantity">&nbsp;
    </p>
        <input type="submit" name="create" class ="button" value="Add into cart">
</form> 
</body>
</html>

A:

If you have a Dataset like stocks use it with stocks NOT Stocks
<sql:query var="stocks" dataSource="healthds">
    SELECT stockid FROM Stocks
</sql:query>`

wrong 
<c:forEach var="row" items="${Stocks.rowsByIndex}">

ok
<c:forEach var="row" items="${stocks.rowsByIndex}">
                              |     |_______________ if you want it '.rowsByIndex' then 'use it' !
                              |_____________________ `s` NOT `S`

Examples without nested <c:forEach

.rowsByIndex
you have only one Data field with : SELECT stockid FROM Stocks
get it with ${row[0]}
 <select name="stock_name">
  <c:forEach var="row" items="${stocks.rowsByIndex}">
        <option><c:out value="${row[0]}"/></option>
  </c:forEach>                      |_________________that's rowsByIndex
 </select>

without .rowsByIndex
 <select name="stock_name">
  <c:forEach var="row" items="${stocks.rows}">
        <option><c:out value="${row.stockid}"/></option>
  </c:forEach>
 </select>

a valid select
 <option value="P101">Pizza Napoli</option>

your select option e.g.
 <option value="astockID1">astockID1</option>

If select visible value and assigned value are the same let value= away
 <option>astockID1</option>

code it's shorter and more readable.
 <option><c:out value="${column}"/></option>

working example tested with Derby sample database table just created FRIENDS 

index.jsp
<%-- Document   : index  Created on : 13.Dez.2014, 20:34:34 --%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@ taglib prefix = "c" uri = "http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>

<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   <title>JSP Page</title>
</head>
<body>
  <h1>Hello World!</h1>
  <sql:setDataSource 
      url="jdbc:derby://localhost:1527/sample;user=app;password=app" 
      driver="org.apache.derby.jdbc.ClientDriver"  
      var="Derbydata"/>  
  <sql:query sql="SELECT * FROM APP.FRIENDS" 
      dataSource="${Derbydata}" 
      var="Friends"/>  

  <select name="friends_id_name">
      <c:forEach var="row" items="${Friends.rowsByIndex}">
       <option><c:out value="${row[0]}"/> <c:out value="${row[1]}"/></option>
      </c:forEach>
  </select>  
</body>
</html>

Output

