none
How to modify SQL information into specific models, eg dropdownlists

    General discussion

  • Hello,

    We are using ms sql atm and we have successfully established a JDBC connecting, between our database and frontend on HTML/JSP We have also successfully retrieved column information but cannot model it into any other form. We are using NetBeans to establish the connection. If anyone could help insert the information into a drop-down menu we woudl be greatful. The following is what we have and what we have been trying.

    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
    <%@page contentType="text/html" pageEncoding="UTF-8"%>


    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
        </head>
        <body>
            <table id="table1">
                <input type="text" id="textbox1" value="">
            <input type="submit" id="buttonz" onclick="hoping">
            </table>
        <sql:query var="result" dataSource="jdbc/Test">
            SELECT*
            FROM ERIT
        </sql:query>
        
        <table border="1">
            <!-- column headers -->
            <tr>
            <c:forEach var="columnName" items="${result.columnNames}">
                <th><c:out value="${columnName}"/></th>
            </c:forEach>
        </tr>
        <!-- column data -->
        <c:forEach var="row" items="${result.rowsByIndex}">
            <tr>
            <c:forEach var="column" items="${row}">
                <td><c:out value="${column}"/></td>
            </c:forEach>
            </tr>
        </c:forEach>
    </table>
        </body>
    </html>



    • Edited by AZeBuilder Thursday, April 19, 2012 7:35 AM
    • Changed type Papy NormandModerator Thursday, April 26, 2012 5:22 PM not related to SQL Server Data Access
    Thursday, April 19, 2012 7:18 AM

All replies

  • I am sorry to tell you that this forum is not suitable for this question though your question is related to sql server somewhere. It says this forum is for data access to SQL Server using SQL Native Client, OLEDB, ODBC, ADO, WDAC/MDAC, JDBC, or SOAP/HTTP.. But your question is more about web page. It's better to ask it in a jsp forum or asp.net forum. More related professors there will miss this related questions if it posted in this forum. 


    smiling~

    Monday, April 23, 2012 7:13 AM