javadbf 的问题,有没有人用过啊。。。。 javadbf开发包有谁用过啊,他支不支持按字段名称赋值写入一条记录,就像操作一个数据库表一样,现在好像只能按照顺序给他放到一个数组里,难道只有这种方式吗,这样很容易弄错啊???还有就是当写入一条记录后,能不能得到这条记录的序号或编号什么的??? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这个方法会根据你传入的数据信息自动生成DBF文件# public static void generateDbfFromArray( # # String dbfName, # # String[] strutName, # # byte[] strutType, # # int[] strutLength, # # Object[][] data # # ) # # { # # OutputStream fos = null; # # try # # { # # int fieldCount = strutName.length; # # DBFField[] fields = new DBFField[fieldCount]; # # for(int i=0;i<fieldCount;i++) # # { # # fields[i] = new DBFField(); # # fields[i].setName(strutName[i]); # # fields[i].setDataType(strutType[i]); # # fields[i].setFieldLength(strutLength[i]); # # } # # DBFWriter writer = new DBFWriter(); # # writer.setFields(fields); # # for(int i=0;i<fieldCount;i++) # # { # # writer.addRecord(data[i]); # # } # # fos = new FileOutputStream(dbfName); # # writer.write(fos); # # } # # catch(Exception e) # # { # # e.printStackTrace(); # # } # # finally # # { # # try{ # # fos.close(); # # }catch(Exception e){} # # } # # }好像只能一条一条取数据,其他的你自己看下api doc吧。 xizhiyao的那段代码有问题的# for(int i=0;i<fieldCount;i++) # # { # # writer.addRecord(data[i]); # # } i<fieldCount改成i<data.length 问个java基础类的问题 大家帮我看一下这个这个程序 为什么不安我的意愿运行呢 java学习方法请教 java double值的问题 Java乱码问题 如何用Java得到图片文件的尺寸? 双击可执行Jar文件没反应---我没辙 如何得到一段字符串的十六进制值和ascii值 大家帮忙分析一下这个小程序的执行顺序 很简单的问题。 帮我看看哪里错了。AJAX 匿名内部类使用final参数的问题
#
# String dbfName,
#
# String[] strutName,
#
# byte[] strutType,
#
# int[] strutLength,
#
# Object[][] data
#
# )
#
# {
#
# OutputStream fos = null;
#
# try
#
# {
#
# int fieldCount = strutName.length;
#
# DBFField[] fields = new DBFField[fieldCount];
#
# for(int i=0;i<fieldCount;i++)
#
# {
#
# fields[i] = new DBFField();
#
# fields[i].setName(strutName[i]);
#
# fields[i].setDataType(strutType[i]);
#
# fields[i].setFieldLength(strutLength[i]);
#
# }
#
# DBFWriter writer = new DBFWriter();
#
# writer.setFields(fields);
#
# for(int i=0;i<fieldCount;i++)
#
# {
#
# writer.addRecord(data[i]);
#
# }
#
# fos = new FileOutputStream(dbfName);
#
# writer.write(fos);
#
# }
#
# catch(Exception e)
#
# {
#
# e.printStackTrace();
#
# }
#
# finally
#
# {
#
# try{
#
# fos.close();
#
# }catch(Exception e){}
#
# }
#
# }
好像只能一条一条取数据,其他的你自己看下api doc吧。
# for(int i=0;i<fieldCount;i++)
#
# {
#
# writer.addRecord(data[i]);
#
# } i<fieldCount改成i<data.length