%@ page contentType="text/html; charset=Shift_JIS" %> <%@ page import="java.sql.*,javahello.DBConnectionPool" %> <%! DBConnectionPool pool; %> <% Connection con = null; Statement stmt = null; try { // コネクションプールクラスのインスタンスを取得 pool = DBConnectionPool.getInstance(); // データベースへの接続を取得 con = pool.getConnection(); // ステートメントオブジェクトを生成 stmt = con.createStatement(); // 全ての行を検索するSQL文を作成 String sql = "SELECT * FROM HELLO_WORLD_TABLE"; // クエリーを実行して結果セットを取得 ResultSet rs = stmt.executeQuery(sql); %>
| NO | 言語 | メッセージ |
|---|---|---|
| <%=rs.getInt("NO") %> | <%=rs.getString("LANGUAGE") %> | <%=rs.getString("MESSAGE") %> |