How to fetch the dropdown values from database and display in jsp

后端 未结 4 1988
谎友^
谎友^ 2020-12-19 18:43

I have two dropdowns in jsp and have to get dropdown list from database and show it in jsp. I am using jsp for the first time . Can you give me an idea to fetch the dropdown

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-19 19:15

    I made this in my code to do that

    note: I am a beginner.

    It is my jsp code.

    <%
    java.sql.Connection Conn = DBconnector.SetDBConnection(); /* make connector as you make in your code */
    Statement st = null;
    ResultSet rs = null;
    st = Conn.createStatement();
    rs = st.executeQuery("select * from department"); %>
     
         
            Student Major  :  
        
    

提交回复
热议问题