while((rowObjects=reader.nextRecord())!=空)
一串
在com。利努森斯。javadbf。DBFReader。nextRecord(DBFReader.java:310)
谢谢你的帮助。
以下是我的代码:
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();
}
}
}