我正在尝试读取一个foxpo .dbf文件,但要低于行的错误:
while(((rowobjects = reader.nextrecord())!= null)
错误:
com.linuxense.javadbf.dbfexception:无法解析号码:空 细绳 在com.linuxense.javadbf.dbfreader.nextrecord(dbfreader.java:310) 在datamigration.datamigration.main(datamigration.java:34)
您的帮助将不胜感激。
谢谢,
如果我的代码:
package datamigration;
import java.io.*;
import com.linuxense.javadbf.*;
public class DataMigration {
public static void main(String args[]) {
try {
InputStream inputStream = new FileInputStream("D:/projects/DataMigration/data/customer.dbf");
DBFReader reader = new DBFReader(inputStream);
reader.setCharactersetName("gbk");
int numberOfFields = reader.getFieldCount();
for (int i = 0; i < numberOfFields; i++) {
DBFField field = reader.getField(i);
System.out.println(field.getName());
}
Object[] rowObjects;
while ((rowObjects = reader.nextRecord()) != null) {
for (int i = 0; i < rowObjects.length; i++) {
System.out.println(rowObjects[i]);
}
}
inputStream.close();
} catch (DBFException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
您是否在:
中查看了各种'发现' Google搜索结果:Java连接到FOXPRO数据库