<%@ page language="java" import="java.sql.*"%>
hockley.ca Logo

Ice Hazards


Hazard Home The Ice Hazards Stats on Ice Hazards Photos of Famous Ice Hazards
<% Class.forName("org.postgresql.Driver"); Connection myConn=DriverManager.getConnection("jdbc:postgresql://localhost/dhockley?user=dhockley&password=linux"); Statement stmt = myConn.createStatement(); ResultSet rs; %>
<% rs = stmt.executeQuery("select player.firstname, player.lastname, playerstats.playerid, sum(playerstats.goals) as goals, sum(playerstats.assists), sum(playerstats.goals + playerstats.assists), sum(playerstats.penaltyminutes), sum(playerstats.teamid), player.jerseynumber where player.playerid = playerstats.playerid group by playerstats.playerid, player.jerseynumber, player.lastname, player.firstname order by sum(playerstats.goals + playerstats.assists) desc, sum(playerstats.goals) desc, player.jerseynumber desc"); while ( rs.next() ) { %> <% } %>
Scoring Stats
Jersey Name GP G A Pts PIM GPG APG PPG PIMPG
<%= rs.getInt(9) %> <%= rs.getString(2) %>, <%= rs.getString(1) %> <%= rs.getInt(8) %> <%= rs.getInt(4) %> <%= rs.getInt(5) %> <%= rs.getInt(6) %> <%= rs.getInt(7) %> <%= (((float)((int)(100.0f *(((float) rs.getInt(4)) / ((float)rs.getInt(8)))))) / 100.0f) %> <%= (((float)((int)(100.0f *(((float) rs.getInt(5)) / ((float)rs.getInt(8)))))) / 100.0f) %> <%= (((float)((int)(100.0f *(((float) rs.getInt(6)) / ((float)rs.getInt(8)))))) / 100.0f) %> <%= (((float)((int)(100.0f *(((float) rs.getInt(7)) / ((float)rs.getInt(8)))))) / 100.0f) %>

History Books

The 2003-2004 regular season stats

<% rs = stmt.executeQuery("select player.firstname, player.lastname, sum(goaliestats.goalsagainst), sum(goaliestats.shots), (select count(goaliestats.teamid) as wins from goaliestats where goaliestats.goalsfor > goaliestats.goalsagainst and goaliestats.playerid = player.playerid) as wins , (select count(goaliestats.teamid) as losses from goaliestats where goaliestats.goalsagainst > goaliestats.goalsfor and goaliestats.playerid = player.playerid) as losses, count(gameid), player.jerseynumber, (select count(goaliestats.teamid) as shutouts from goaliestats where goaliestats.goalsagainst = 0 and goaliestats.playerid = player.playerid), (select count(goaliestats.teamid) as ties from goaliestats where goaliestats.goalsagainst = goaliestats.goalsfor and goaliestats.playerid = player.playerid) as ties from player, goaliestats where player.playerid = goaliestats.playerid group by player.playerid, player.jerseynumber, player.lastname, player.firstname order by wins desc"); int games = 0; int wins = 0; int losses = 0; int ties = 0; int shutouts = 0; int goalsagainst = 0; int shotsagainst = 0; while (rs. next() ) { %> <% games += rs.getInt(7); wins += rs.getInt(5); losses += rs.getInt(6); ties += rs.getInt(10); shutouts += rs.getInt(9); goalsagainst += rs.getInt(3); shotsagainst += rs.getInt(4); } %>
Goaltending Stats
Jersey Name GP W L T SO GAA GA SA SVPct
<%= rs.getInt(8) %> <%= rs.getString(2) %>, <%= rs.getString(1) %> <%= rs.getInt(7) %> <%= rs.getInt(5) %> <%= rs.getInt(6) %> <%= rs.getInt(10) %> <%= rs.getInt(9) %> <%= (float)((int)(((float)rs.getInt(3) / ((float)(rs.getInt(7))) * 100.0f)))/100.0f %> <%= rs.getInt(3) %> <%= rs.getInt(4) %> <%= (float)((int)(((float)(rs.getInt(4) - rs.getInt(3))) / ((float)rs.getInt(4)) * 1000.0f)) / 1000.0f %>
TOTALS <%= games %> <%= wins %> <%= losses %> <%= ties %> <%= shutouts %> <%= (float)((int)(((float)goalsagainst / ((float)(games)) * 100.0f)))/100.0f %> <%= goalsagainst %> <%= shotsagainst %> <%= (float)((int)(((float)(shotsagainst - goalsagainst)) / ((float)shotsagainst) * 1000.0f)) / 1000.0f %>
<% myConn.close(); %>