martes, 22 de mayo de 2012

Restaurar un backup de postgresql hecho pg_dump


  1. ejecutar el SQL Shell (psql)
  2. escribir la siguiente sintaxis
psql -h ubicación -p puerto -U usuario -d nombre_base_datos -f fichero.backup

viernes, 4 de mayo de 2012

JAVA - Saber si un String es un numero


 public static boolean isNumeric(String string) {
        if (string == null || string.isEmpty()) {
            return false;
        }
        int i = 0;
        if (string.charAt(0) == '-' || string.charAt(0) == '+') {
            if (string.length() > 1) {
                i++;
            } else {
                return false;
            }
        }
        for (; i < string.length(); i++) {
            if (!Character.isDigit(string.charAt(i))) {
                return false;
            }
        }
        return true;
    }