0

I have an idea how to do this, but never did it before

heres my code:

<label for="weatherCity">City:</label>
<select name="weatherCity" id="Cities">
<option value="0"> </option>

here's my query:

SELECT distinct state
FROM ols_weather_current
ORDER BY 1 asc;

Connection connection;
PreparedStatement pstmt;
ResultSet rst2;


try { // execute the query
connection = DataBaseConnectionManager.getConnection();
String sqlQuery = "SELECT distinct state FROM ols_weather_current
    ORDER BY 1 asc";
pstmt = connection.prepareStatement(sqlQuery);
ResultSet rst2;

rst2 = pstmt.executeQuery(sqlQuery2);

%>
<tr>
<td> State:
<select>;
<% while (rst2.next ()) {

}  ("</select>");
%>

Im not sure how to set up the while statement...any help would be appreciated


thanx

2
Contributors
1
Reply
2
Views
10 Years
Discussion Span
Last Post by Sulley's Boo
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.