java servlet query with parameters from html form
<p>I am trying to create a servlet which can obtain the parameter of the drop down box in html and use this parameter to query a database.</p>

<p>my html:</p>

<pre><code>&lt;form action="servlet/currencyservlet"&gt;
&lt;select&gt;
&lt;option name="usd"&gt;United States Dollar&lt;/option&gt;
&lt;option name="pounds"&gt;United Kingdom Sterling Pound&lt;/option&gt;
&lt;/select&gt;
&lt;select&gt;
&lt;option name="cad"&gt;Canadian Dollars&lt;/option&gt;
&lt;option name="cny"&gt;Chinese Yuan&lt;/option&gt;
&lt;/select&gt;
&lt;input type="submit" value="Check Rate"/&gt;
&lt;/form&gt;
</code></pre>

<p>my java:</p>

<pre><code>...
...
...
conn = DriverManager.getConnect("jdbc:mysql://localhost:3306/currencydb", "root", "");
...
try{
string qstr = "SELECT source_currency, target_currency FROM currencytable WHERE????
}
</code></pre>

<p>"source_currency" can be "usd" or "pounds" where "target_currency" can be "cny" or "cad". My query wishes to extract the exchange rate from the "currencytable" and display result in the servlet. How do I parse the parameters of the drop down boxes?</p>
