I am trying to fill the select box values(split values by comma) from mysql database.First, i show my DB design below,
Standard Subject Features
I Science Plants,Animals,Humans,Nature
I Maths Integer,Division,Modules
II Science BB,CC,DD,FF,GG
my code i tried so far,
ListFeature.jsp
<select name="chapterdropdown" id="chapterdropdown"
onchange="selectchange()">
<%
Class.forName("com.mysql.jdbc.Driver");
Connection connection =DriverManager.getConnection("jdbc:mysql://localhost:3306/raptor1_5","root","");
Statement st=connection.createStatement();
ResultSet rs=st.executeQuery("select * from contentselection where Standard='"+class1+"' and Subject='"+subject+"'");
while(rs.next())
{
String featvar = rs.getString("Features");
// here how to split the features by comma???
%>
<option><%=featvar%></option>
<% } %>
%>
</select>
there selected feautures should display one by one in chapterdropdown select box.
Please someone fix my problem.