public static long getDbSum() { long sum = 0; String sql = "select table_name,table_rows from tables where TABLE_SCHEMA = '" + db + "' order by table_rows desc;"; //System.out.println(sql); try { ps = conn.prepareStatement(sql); rs = ps.executeQuery(); while (rs.next()) { sum += rs.getInt(2); } } catch (Exception e) { e.printStackTrace(); } return sum; }