Example usage for java.util.logging Level SEVERE

List of usage examples for java.util.logging Level SEVERE

Introduction

In this page you can find the example usage for java.util.logging Level SEVERE.

Prototype

Level SEVERE

To view the source code for java.util.logging Level SEVERE.

Click Source Link

Document

SEVERE is a message level indicating a serious failure.

Usage

From source file:local.Statistics.LessSellCars.java

/**
 * @param args the command line arguments
 *///from w  w  w  .  j av  a 2  s .c  o  m
public static void carrosMenosVendidos() {
    Graficas_DAO gr = new Graficas_DAO();
    ResultSet rs = gr.getgraficaautomas();
    try {
        String nameAuto;
        int quantitySales;
        DefaultPieDataset data = new DefaultPieDataset();
        while (rs.next()) {
            nameAuto = rs.getString(3);
            quantitySales = rs.getInt(1);
            data.setValue(nameAuto, quantitySales);
        }
        JFreeChart chart = ChartFactory.createPieChart("GRAFICAS AUTOS MENOS VENDIDOS", data, true, true,
                false);
        ChartFrame frame = new ChartFrame("Autos menos vendidos", chart);
        frame.pack();
        frame.setVisible(true);
        rs.close();
        gr.close();
    } catch (SQLException ex) {
        Logger.getLogger(LessSellCars.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:com.quangphuong.crawler.dbutil.DBHandler.java

public static Connection openConnection() {
    try {/*w w w  .  j av  a2  s. c  o  m*/
        Class.forName("com.mysql.jdbc.Driver");
        boolean isDebug = System.getenv("OPENSHIFT_APP_NAME") == null;
        DBConfig dBConfig;
        if (isDebug) {
            dBConfig = new DBConfig(DBConstant.driver, DBConstant.host, DBConstant.port, DBConstant.schema,
                    DBConstant.user, DBConstant.password);
        } else {
            dBConfig = new DBConfig(DBConstant.driver, DBConstant.OPENSHIFT_HOST, DBConstant.OPENSHIFT_PORT,
                    DBConstant.schema, DBConstant.OPENSHIFT_USER, DBConstant.OPENSHIFT_PASSWORD);
        }
        System.out.println("COnnection str: " + dBConfig.toString());
        Connection connection = DriverManager.getConnection(dBConfig.toString(), dBConfig.getUser(),
                dBConfig.getPassword());

        return connection;
    } catch (Exception ex) {
        Logger.getLogger(DBConfig.class.getName()).log(Level.SEVERE, null, ex);
    }
    return null;
}

From source file:controller.NewEntryVideoControllerTest.java

@AfterClass
public static void tearDownClass() {
    String fSeparator = File.separator;
    File file = new File("." + fSeparator + "MyDiaryBook" + fSeparator);
    try {/*w  w w  .jav a2 s .co m*/
        FileUtils.deleteDirectory(file);
    } catch (IOException ex) {
        Logger.getLogger(NewEntryVideoControllerTest.class.getName()).log(Level.SEVERE, null, ex);
    }

}

From source file:app.Mysqlconector.java

public static void liberaConexion(Connection conexion) {
    try {//from w  w w  .j a  v a  2s . c  o  m
        // En realidad no cierra, solo libera la conexion.
        conexion.close();
    } catch (SQLException ex) {
        Logger.getLogger(Mysqlconector.class.getName()).log(Level.SEVERE, null, ex);
    }

    //   conexion=null;
}

From source file:com.cyphermessenger.utils.Utils.java

public static byte[] sha256(byte[] s) {
    try {//from   ww  w  . j av a 2  s .co  m
        return MessageDigest.getInstance("SHA-256").digest(s);
    } catch (NoSuchAlgorithmException ex) {
        Logger.getLogger(Utils.class.getName()).log(Level.SEVERE, null, ex);
        return null;
    }
}

From source file:com.krj.karbon.GetPlayerSummaries.java

/**
 *
 * @param user//from www . j av  a 2  s.  com
 * @param steamId
 * @return
 */
public static SteamAccount retrieve(SteamAccount user, String steamId) {
    try {

        //setup the steamId
        String id = "&steamids=" + steamId;

        //get the map of player info from the steamAPI
        List<Map> playerMaps = getPlayerMaps(id);

        //set the info from the map to the player
        if (playerMaps != null) {
            for (Map map : playerMaps) {
                user = getUserInfo(user, map);
            }
        }
    } catch (IOException ex) {
        Logger.getLogger(GetOwnedGames.class.getName()).log(Level.SEVERE, null, ex);
    }

    return user;
}

From source file:io.trivium.anystore.StoreUtils.java

public static void cleanStore() {
    Logger logger = Logger.getLogger(StoreUtils.class.getName());
    logger.info("cleaning persistence store");
    String path = Central.getProperty("basePath");
    if (!path.endsWith(File.separator))
        path += File.separator;//from   w  w  w. j  a v  a  2s .c  o  m
    path += "store" + File.separator;
    try {
        File f = new File(path + meta);
        if (f.exists())
            FileUtils.deleteQuietly(f);
    } catch (Exception e1) {
        logger.log(Level.SEVERE, "cleaning meta store failed", e1);
    }
    try {
        File f = new File(path + data);
        if (f.exists())
            FileUtils.deleteQuietly(f);
    } catch (Exception e1) {
        logger.log(Level.SEVERE, "cleaning data store failed", e1);
    }
    try {
        File f = new File(path + local);
        if (f.exists())
            FileUtils.deleteQuietly(f);
    } catch (Exception e1) {
        logger.log(Level.SEVERE, "cleaning local store failed", e1);
    }
}

From source file:com.inkubator.hrm.util.HrmUserInfoUtil.java

public static String getRealName() {
    HrmUserService hrmUserService = (HrmUserService) ServiceWebUtil.getService("hrmUserService");
    String hrmUserName = getUserName();
    try {//from  w  w  w. j a v  a 2s  .  co  m
        return hrmUserService.getByUserIdOrEmail(hrmUserName).getRealName();
    } catch (Exception ex) {
        Logger.getLogger(HrmUserInfoUtil.class.getName()).log(Level.SEVERE, null, ex);
    }
    return null;
}

From source file:local.Statistics.LessSellRepuesto.java

/**
 * @param args the command line arguments
 *///from  w  w w. jav a2s.  c  om
public static void repuestosMenosVendidos() {
    Graficas_DAO gr = new Graficas_DAO();
    //obtencion de datos
    ResultSet rs = gr.getgraficarepuestomen();
    try {
        String nameAuto;
        int quantitySales;
        DefaultPieDataset data = new DefaultPieDataset();
        while (rs.next()) {
            nameAuto = rs.getString(3);
            quantitySales = rs.getInt(1);
            data.setValue(nameAuto, quantitySales);
        }
        JFreeChart chart = ChartFactory.createPieChart("GRAFICAS REPUESTO MENOS VENDIDOS", data, true, true,
                false);
        ChartFrame frame = new ChartFrame("Repuestos menos vendidos", chart);
        frame.pack();
        frame.setVisible(true);
        rs.close();
        gr.close();
    } catch (SQLException ex) {
        Logger.getLogger(LessSellRepuesto.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:local.Statistics.MostSellCars.java

/**
 * @param args the command line arguments
 *///from   w w  w. ja va2s.c  o  m
public static void carrosMasVendidos() {
    Graficas_DAO gr = new Graficas_DAO();
    //obtencion de datos
    ResultSet rs = gr.getgraficaautomas();

    try {
        String nameAuto;
        int quantitySales;
        Object[] fila = new Object[3];
        DefaultPieDataset data = new DefaultPieDataset();
        while (rs.next()) {

            nameAuto = rs.getString(3);
            quantitySales = rs.getInt(1);
            data.setValue(nameAuto, quantitySales);
        }
        JFreeChart chart = ChartFactory.createPieChart("GRAFICAS AUTOS MAS VENDIDOS", data, true, true, false);
        ChartFrame frame = new ChartFrame("Autos mas vendidos", chart);
        frame.pack();
        frame.setVisible(true);

        rs.close();
        gr.close();
    } catch (SQLException ex) {
        Logger.getLogger(MostSellCars.class.getName()).log(Level.SEVERE, null, ex);
    }
}