%@page language="java" import="java.sql.*"%> <%! Driver driver = null; String dbURL = null; Connection conn = null; Statement stat = null; ResultSet rs = null; Object rsValue = null; int counter; %> <% try { driver = (Driver) Class.forName("org.hsqldb.jdbcDriver").newInstance(); dbURL = "jdbc:hsqldb:" + application.getRealPath("/~polykandriotis/poly/poly"); conn = DriverManager.getConnection(dbURL,"sa", ""); stat = conn.createStatement(); rs = stat.executeQuery("SELECT * FROM guest"); } catch (Exception e) { out.print("Unable to make connection to guestbook"); out.print(e); } %>
Please leave your comments on this site for Yianni.
| Entry no. <%= ++counter %> | Name: <%=(((rsValue = rs.getObject("name"))==null || rs.wasNull())?"":rsValue)%> |
Email: <%=(((rsValue = rs.getObject("email"))==null || rs.wasNull())?"":rsValue)%> | Comments: <%=(((rsValue = rs.getObject("message"))==null || rs.wasNull())?"":rsValue)%> |