Skip to main content

Posts

Showing posts from December, 2012

Leer dbf desde Java

Cuando necesites leer bases de datos de Foxpro desde Java, mi amigo Diego Silva creo hace un tiempo una librería muy útil para comunicarnos con los archivos dbf http://www.apuntesdejava.com/2007/09/dbf-2-java-library.html Descargamos el archivo .jar  desde  https://code.google.com/p/dbf2java-library/ Agregamos el jar al proyecto, y seguimos los siguientes pasos  public static void main(String[] args) throws IOException {        try {            // TODO code application logic here            DbfFile bfile;       bfile = new DbfFile("/home/avbravo/empresas.dbf"); // abrir el archivo            bfile.open();           System.out.println(" contador " + bfile.getCount()); //recorrer los registros            for (int i = 0; i < bfile.getCount(); i++) { //colocar el cursor en el registro                bfile.go(i);                Map<String, String> map = bfile.scatter();                Iterator it = map.keySet().iterator();                while