hi sarika,
The code uses MS Access as database for
JDBC. This is just a sample code. But the logic will be same for all databases.
<html>
<head>
<title>Combo Box Data from Database</title>
</head>
<%@ page import="java.sql.*"%>
<body>
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc
dbc
SN_Name";
Connection con = DriverManager.getConnection(url);
Statement s = con.createStatement();
ResultSet re = s.executeQuery("select * from Table_Name");
%>
<h2>Username from Database Modified: </h2>
<select>
<%
while(re.next())
{
String un=re.getString(Field_Name);
%>
<option value="<%= un%>"><%= un%></option>
<%
}
%>
</select>
</body>
</html>