jndi3.jsp

<%@ page contentType="text/html; charset=euc-jp" %>
<%@ taglib uri="jruntags" prefix="jrun" %>
<%@ page import="java.sql.*" %>
<%@ page import="javax.sql.*" %>
<%@ page import="allaire.taglib.*" %>

<%--
		"taglib" is a datasource defined by default with JRun. Check the JMC
		or local.properties ( of default server ) for this datasource description.
--%>
<jrun:jndi action="lookup" name="java:comp/env/jdbc/taglib" id="obj"/>

<%@ include file="html/header.html" %>
<table width="100%">
<tr>
<td colspan="2"><b>JNDI タグ: JNDI タグを使用しての DataSource の取得</b>( <a href="html/jndi3_jsp.html">ソースの表示</a> )
</td>
</tr>

<jrun:param id="obj" type="DataSource"/>
<%
	Connection connection = (Connection)obj.getConnection();
%>

<tr><td>

<%--
	Display Table Results
--%>
<jrun:sql connection="<%= connection %>" id="rs">
SELECT * FROM ACCOUNTS
</jrun:sql>

<br/><br/>
<table border="1" width="100%">
<tr>
<%--
<%
	QueryTable rs = (QueryTable)pageContext.getAttribute("rs");
%>
--%>
<jrun:param id="rs" type="QueryTable"/>
<jrun:foreach item="field" type="String" group="<%= rs.Names %>">
    <td align="center"><ul><b><%= field.toUpperCase() %></b></ul></td>
</jrun:foreach>
</tr>
<jrun:foreach group="page.rs">
<tr>
    <jrun:foreach item="x" group="<%= rs.Values %>">
        <td align="center"><%= x %></td>
    </jrun:foreach>
</tr>
</jrun:foreach>

</table>


</td></tr>

<tr>
<td align="left">
&nbsp;<br>
&nbsp;&nbsp;<font size="2"><a href="jndi2.jsp">戻る</a></font>
</td>
</tr>
</table>

<%@ include file="html/footer.html" %>