<%@page contentType="text/html" import="java.sql.*, java.text.SimpleDateFormat"%> <%@page pageEncoding="UTF-8"%> cheesebread's naughty words

cheesebread's naughty words

What naughty words can you think of? Here's a list to help you. You can add one if you like.

<% try { String strHost = "localhost"; String strDBName = "flinge43_nw"; String strConnectURL = ("jdbc:mysql://" + strHost + "/" + strDBName); String strUser = "flinge43_nw"; String strPassword = "ghw498fh9egh3"; // implicitly load the driver - static code in Driver registers itself with JDBC driver manager Class.forName("com.mysql.jdbc.Driver").newInstance(); Connection con = DriverManager.getConnection(strConnectURL, strUser, strPassword); Statement s = con.createStatement(); String strSQL = "SELECT * FROM `words` ORDER BY `when` DESC"; ResultSet results = s.executeQuery(strSQL); out.println(""); // always call .next to select first record while (results.next()) { out.println(""); out.println(" "); out.println(" "); out.println(""); out.println(""); out.println(" "); out.println(" "); out.println(""); out.println(""); out.println(" "); Timestamp ts = results.getTimestamp("when"); SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy @ H:mm"); out.println(" "); out.println(""); } out.println("
Word:" + results.getString("word") + " [" + results.getString("pro") + "]
Meaning:" + results.getString("mean") + "
From:

 
" + results.getString("from") + " - " + df.format(ts) + "

 
"); results.close(); s.close(); con.close(); } catch( SQLException e ) { // print details of SQL error // could be multiple errors chained together out.println("Fucksocks:
"); while ( e != null) { out.println("SQLException : " + e.getMessage() + "
"); out.println("SQLState : " + e.getSQLState() + "
"); out.println("SQLCode : " + e.getErrorCode() + "
"); e = e.getNextException(); out.println("
"); } } catch ( Exception e) { // some other exception out.println("Fucksocks:
" + e + "
"); } %>