You are on page 1of 1

<%

Class.forName("com.mysql.jdbc.Driver");

Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/EGasBooking","root","root");

Statement st=con.createStatement();
ResultSet rs= st.executeQuery("select * from Distributer");
while(rs.next())
{
%>
<tr>
<td>Select Distributor</td><td><select name="ddlDistributor">
<option value="Select->">Select-></option>
<option value=<%=rs.getString("UserName")%>><
%=rs.getString("UserName")%></option>
</select></td>
</tr>
<%
}
rs.close();

//response.sendRedirect("StockMaintain.jsp");

%>

You might also like