<%@ page language="java" session="true" info=""%> <%@ page import="java.util.*"%> <%@ page import="java.sql.*"%> <%! static { try { Class.forName("org.gjt.mm.mysql.Driver").newInstance(); } catch (Exception e) { //n = n + "Unable to load the driver
" + e.toString() + "

"; System.err.println("Unable to load the driver."); e.printStackTrace(); } } String showTable() { StringBuffer buf = new StringBuffer(); int cnt = 0; try { Connection conn = DriverManager.getConnection("jdbc:mysql://oberon.ssw.uni-linz.ac.at/test?user=ssw"); Statement stat = conn.createStatement(); ResultSet res = stat.executeQuery("SELECT * FROM registration order by regdate, regtime;"); ResultSetMetaData meta = res.getMetaData(); buf.append(""); for(int i = 1; i <= meta.getColumnCount(); i++) { buf.append(""); } buf.append(""); while(res.next()) { cnt++; buf.append(""); for(int i = 1; i <= meta.getColumnCount(); i++) { buf.append(""); } //buf.append(""); buf.append(""); } res.close(); buf.append("
" + meta.getColumnName(i) + "
" + res.getString(i) + " Delete
"); buf.append("

" + cnt + " Anmeldungen

"); conn.close(); } catch (SQLException e) { System.out.println("SQLException: " + e.getMessage()); System.out.println("SQLState: " + e.getSQLState()); System.out.println("VendorError: " + e.getErrorCode()); buf.append("SQLException: " + e.getMessage() + "
SQLState: " + e.getSQLState() + "
VendorError: " + e.getErrorCode() + "

"); } catch (Exception e) { buf.append("Unable to retrieve data\n" + e.toString() + "

"); //System.err.println("Unable to retrieve the articles."); //e.printStackTrace(); } return buf.toString(); } %> Anmelde-Ergebnisse <%if(request.getRemoteAddr().startsWith("140.78.145.")) { %>

Anmelde-Ergebnisse

Eintrag löschen

<%=showTable()%> <% } else { %>

Access denied

<% } %> <%@ include file="footer.jsp" %>