java/nekurak.net-web/web/sql-znacky.jsp
changeset 37 1b481b911614
parent 36 663fa0431c27
child 38 a2ca6c1804d1
     1.1 --- a/java/nekurak.net-web/web/sql-znacky.jsp	Sun Feb 21 12:26:43 2010 +0100
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,47 +0,0 @@
     1.4 -<?xml version="1.0" encoding="UTF-8"?>
     1.5 -<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
     1.6 -	  xmlns:sql="http://java.sun.com/jsp/jstl/sql"
     1.7 -	  xmlns:c="http://java.sun.com/jsp/jstl/core"
     1.8 -	  version="2.0">
     1.9 -    <jsp:directive.page contentType="application/xhtml+xml"/>
    1.10 -    <jsp:output doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
    1.11 -		doctype-root-element="html"
    1.12 -		omit-xml-declaration="false"/>
    1.13 -
    1.14 -    <html xmlns="http://www.w3.org/1999/xhtml">
    1.15 -	<head>
    1.16 -	    <title>SQL značky</title>
    1.17 -	</head>
    1.18 -	<body>
    1.19 -	    <h1>SQL značky</h1>
    1.20 -
    1.21 -
    1.22 -	    <!-- nastavíme výchozí datový zdroj -->
    1.23 -	    <sql:setDataSource dataSource="jdbc/nekurak"/>
    1.24 -
    1.25 -	    <!-- Jednoduchý dotaz -->
    1.26 -	    <pre>SELECT * FROM podnik;</pre>
    1.27 -	    <sql:query var="podniky">SELECT * FROM podnik;</sql:query>
    1.28 -	    <ul>
    1.29 -		<c:forEach items="${podniky.rowsByIndex}" var="p">
    1.30 -		    <li><c:out value="${p[1]}"/></li>
    1.31 -		</c:forEach>
    1.32 -	    </ul>
    1.33 -
    1.34 -	    <!-- Parametrizovaný dotaz -->
    1.35 -	    <pre>SELECT * FROM podnik WHERE nazev = ?;</pre>
    1.36 -	    <sql:query var="podniky" sql="SELECT * FROM podnik WHERE nazev = ?;">
    1.37 -		<!-- všimněte si, že vlastní SQL dotaz můžeme zapsat buď do těla elementu nebo do atributu „sql“ -->
    1.38 -		<sql:param value="Na Kovárně"/>
    1.39 -	    </sql:query>
    1.40 -	    <ul>
    1.41 -		<c:forEach items="${podniky.rowsByIndex}" var="p">
    1.42 -		    <li><c:out value="${p[1]}"/></li>
    1.43 -		</c:forEach>
    1.44 -	    </ul>
    1.45 -
    1.46 -
    1.47 -	</body>
    1.48 -    </html>
    1.49 -
    1.50 -</jsp:root>