-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquery5.jsp
38 lines (28 loc) · 831 Bytes
/
query5.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<%@ page import="java.io.*,java.util.*,java.sql.*"%>
<%@ page import="javax.servlet.http.*,javax.servlet.*" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
<html>
<head>
<title>Count of Clients</title>
</head>
<body>
<sql:setDataSource var="snapshot" driver="oracle.jdbc.OracleDriver"
url="jdbc:oracle:thin:@aloe.cs.arizona.edu:1521:oracle"
user="tkoch" password="a6743"/>
<sql:query dataSource="${snapshot}" var="result">
SELECT count(mattseall.client.client_id) as theCount
from mattseall.client
</sql:query>
<table border="1" width="100%">
<tr>
<th>Number of Clients</th>
</tr>
<c:forEach var="row" items="${result.rows}">
<tr>
<td><c:out value="${row.theCount}"/></td>
</tr>
</c:forEach>
</table>
</body>
</html>