Database Reference
In-Depth Information
| 2008 | Children 18:3 | Children 18:3 |
| 2004 | Dave Bainbridge | Veil of Gossamer |
| 1990 | Iona | Iona |
| 2011 | Iona | Another Realm |
| 2005 | Neal Morse | ? |
| 2013 | Red | Release the Panic |
| 1982 | Undercover | Undercover |
+------+-----------------+-------------------+
To display this query result as a bordered HTML table, produce output that looks
something like this:
<table
border=
"1"
>
<tr>
<th>
Year
</th>
<th>
Artist
</th>
<th>
Title
</th>
</tr>
<tr>
<td>
2002
</td>
<td>
Aradhna
</td>
<td>
Marga Darshan
</td>
</tr>
<tr>
<td>
1999
</td>
<td>
Charlie Peacock
</td>
<td>
Kingdom Come
</td>
</tr>
... other rows here ...
<tr>
<td>
1982
</td>
<td>
Undercover
</td>
<td>
Undercover
</td>
</tr>
</table>
To convert the results of a query to an HTML table, wrap each value from a given result
set row in cell tags, each row in row tags, and the entire set of rows in table tags. A JSP
page might produce an HTML table from the
cd
table query like this:
<table
border=
"1"
>
<tr>
<th>
Year
</th>
<th>
Artist
</th>
<th>
Title
</th>
</tr>
<sql:query
dataSource=
"${conn}"
var=
"rs"
>
SELECT year, artist, title FROM cd ORDER BY artist, year
</sql:query>
<c:forEach
items=
"${rs.rows}"
var=
"row"
>
<tr>
<td><c:out
value=
"${row.year}"
/></td>
<td><c:out
value=
"${row.artist}"
/></td>