I am new to Java EE. I am using a checkbox which is showing some technology field. Now I am trying to fetch specific data within a option tag from one table while clicking on a perticular technology field. I am using AJAX call to generate the dropdown box when clicking on a perticular technology but cannot fetch the specific data from the table. how can i do that in a jsp page. My Code is as follows
    <table bgcolor="#ffffff" class="style2">
        <tr>
            <td align="center" valign="middle">
                <select name="year">
                    <option value="Select">Select</option>>
                    <%
                                try {
                                    Class.forName("oracle.jdbc.driver.OracleDriver");
                                    Connection con = DriverManager.getConnection("jdbc:oracle:thin:@192.168.3.1:1521:wtlctax1", "****", "****");
                                    Statement stmt = con.createStatement();
                                    ResultSet rs = stmt.executeQuery("select exp_year.year from exp_year INNER JOIN technology ON exp_year.t_cd = technology.t_cd");
                                            while (rs.next()) {
                                                String str = rs.getString("year");
                                                String str1 = rs.getString("t_cd");
                    %>
                    <option value="<%=str%>"><%=str%></option>
                    <% } %>
                </select>
             </td>
        </tr>
        <%
                        }
                    catch (Exception e) {
                        System.out.println(e);
                    }
        %>
    </table>
 
    