Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jun 2018
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    List View in JSP from database:

    In Javascript programming I have made a list containing items from database. Now I want to display it's details(taken from database)in a textbox whenever a particular list item is selected.

    Code done till now


    Code:
    <body   bgcolor=#D3D3D3>
        <%
        Class.forName("com.mysql.jdbc.Driver").newInstance();
        Connection connection = 
         DriverManager.getConnection
            ("jdbc:mysql://127.0.0.1:3306/userinfo?user=root&password=admin");
    
       Statement statement = connection.createStatement() ;
    
       resultset =statement.executeQuery("select * from item") ;
    %>
    <center><h1><bold><font size="12">Form</font></bold></h1></center>
        <h5><font size="4">Item Supplier
        <select>
        <%  while(resultset.next()){ %>
            <option><%= resultset.getString(1)%>  <%= resultset.getString(2)%></option>
        <% } %>
        </select></font>
        <div class="item2"><input type="text" name="item" value="" size="165" disabled="disabled" /></div>
    
        </h5>
    <h6>
    here in last part i want to display it in div class that input text box..
    Note: Both the list item names and details to be showed in the input box are from the same table in the same database... I want the code
    Help me..``

  2. #2
    Super Moderator vinyl-junkie's Avatar
    Join Date
    Jun 2003
    Posts
    3,375
    Thanks
    3
    Thanked 47 Times in 47 Posts
    This is java, not javascript. The two are completely different.

    Thread moved to the Java and JSP forum.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    SNAP to it!

  3. #3
    New to the CF scene
    Join Date
    Jun 2018
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by vinyl-junkie View Post
    This is java, not javascript. The two are completely different.

    Thread moved to the Java and JSP forum.
    My bad but I want a solution for this


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •