1 package org.ashkelon.pages; 2 3 import org.ashkelon.*; 4 import org.ashkelon.db.*; 5 6 import java.util.*; 7 import java.sql.*; 8 9 10 13 public class StatsClasses extends Page 14 { 15 public StatsClasses() 16 { 17 super(); 18 } 19 20 public String handleRequest() throws SQLException 21 { 22 List stats = getClassStats(); 23 request.setAttribute("classCounts", stats); 24 return null; 25 } 26 27 28 34 public List getClassStats() throws SQLException 35 { 36 43 44 String sql = DBMgr.getInstance().getStatement("classstats"); 45 46 Statement stmt = conn.createStatement(); 47 ResultSet rset = stmt.executeQuery(sql); 48 49 List stats = new ArrayList(100); 50 51 List info = null; 52 53 JPackage pkg = null; 54 while (rset.next()) 55 { 56 info = new ArrayList(2); 57 pkg = new JPackage(rset.getString(1)); 58 pkg.setId(rset.getInt(2)); 59 info.add(pkg); 60 info.add(rset.getString(3)); 61 stats.add(info); 62 } 63 64 return stats; 65 } 66 67 68 } 69 | Popular Tags |