public static Connection getConection() {
        try {
            System.out.print("Conecting with the database... ");
            Class.forName("com.mysql.jdbc.Driver");

            if (properties == null) {
                properties = ResourceBundle.getBundle("MySQL");

                host = properties.getString("host");
                port = properties.getString("port");
                database = properties.getString("database");
                user = properties.getString("user");
                password = properties.getString("password");
            }

            Connection con = DriverManager.getConnection(
                    String.format("jdbc:mysql://%s:%s/%s", host, port, database),
                    user, password);

            System.out.println("success.");
            return con;
        } catch (ClassNotFoundException ex) {
            System.out.println("failed.\n" + ex);
            return null;
        } catch (SQLException ex) {
            System.out.println("failed.\n" + ex);
            return null;
        } catch (MissingResourceException ex) {
            System.out.println("failed.\n" + ex);
            return null;
        }
    }