当前位置: 首页 > news >正文

丹阳市制作网站网站制作的流程

丹阳市制作网站,网站制作的流程,如何做黄色网站不犯法,电商网站域名规则基于Java实现DBase DBF文件的解析和显示 JDK19编译运行,实现了数据库字段和数据解析显示。 首先解析数据库文件头代码 byte bytes[] Files.readAllBytes(Paths.get(file));BinaryBufferArray bis new BinaryBufferArray(bytes);DBF dbf new DBF();dbf.VersionN…

基于Java实现DBase DBF文件的解析和显示

JDK19编译运行,实现了数据库字段和数据解析显示。

首先解析数据库文件头代码

		byte bytes[] = Files.readAllBytes(Paths.get(file));BinaryBufferArray bis = new BinaryBufferArray(bytes);DBF dbf = new DBF();dbf.VersionNumber = bis.ReadUInt8();		// 版本号dbf.DateOfLastUpdate = bis.ReadBytes(3);  	// 最后更新日期dbf.NumberOfRecords = bis.ReadUInt32();		// 记录数量dbf.LengthOfHeaderStructure = bis.ReadUInt16();	// 文件头长(内容开始位置)dbf.LengthOfEachRecord  = bis.ReadUInt16();	// 每条记录长度short Reserved = bis.ReadInt16();dbf.IncompleteTransac = bis.ReadUInt8();	dbf.EncryptionFlag = bis.ReadUInt8();dbf.FreeRecordThread = bis.ReadInt32();long ReservedForMultiUser= bis.ReadInt64();dbf.MDXFlag = bis.ReadUInt8();dbf.LanguageDriver = bis.ReadUInt8();	Reserved = bis.ReadInt16();

解析字段代码

		dbf.fields = new Vector<Field>();while (true) {byte _b = bis.ReadInt8();if (_b == 0x0d) 	// 是否结束break ;byte[] bs = bis.ReadInt8(31);byte[] all = new byte[32];all[0] = _b;System.arraycopy(bs, 0, all, 1, 31);Field field = Field.parse(all);	dbf.fields.add(field);}
	static Field parse(byte[] b) throws IOException  {Field field = new Field();BinaryBufferArray t = new BinaryBufferArray(b);field.name = t.ReadAsciiString(11).trim();	//字段名称field.type = t.ReadAsciiChar();				// 字段类型t.SkipBytes(4);field.length = t.ReadUInt8();				// 字段长度field.precision = t.ReadUInt8();			// 精度t.SkipBytes(2);field.id = t.ReadUInt8();t.SkipBytes(10);field.mdx = t.ReadUInt8();return field;}

解析数据代码:

		dbf.resultset = new Vector<Map<String, Object>>();	//结果集for (int i=0; i<dbf.NumberOfRecords-1; i++) {char delete = '\0';		delete = bis.ReadAsciiChar();	// 读入删除标记HashMap<String,Object> map = new HashMap<>();for (int j=0; j<dbf.fields.size(); j++) {Field field = dbf.fields.get(j);char type = field.getType();int len = field.getLength();Object val = null;byte[] b = bis.ReadBytes(len);	//读取字段值if (field.getType() == 'N')val = new String(b);else if (field.getType() =='C')val = new String(b, "UTF-8");map.put(field.getName(), val);}map.put("delete", delete);dbf.resultset.add(map);}

读入dbf文件,解析显示如下:

http://www.tj-hxxt.cn/news/55009.html

相关文章:

  • 做购物网站 营业范围是什么东莞网站优化
  • 哈尔滨模板自助建站福州百度快照优化
  • wordpress文章自定义字段开发网站seo优化免费
  • 金华建设局网站节能备案登记表十大营销案例分析
  • 上海企业网站模板建站平台上海seo优化服务公司
  • php网站开发是什么太原seo全网营销
  • 大型网站制作费用表seo助手
  • 企业网站建设一般要素统计网站流量的网站
  • 怎么查询网站是否收录海南百度推广公司电话
  • 网站建设步骤详解一手app推广接单平台
  • 展现真实网站深圳市seo点击排名软件价格
  • 国外做珠宝的网站有哪些win7系统优化工具
  • 专业做网站咨询淘宝权重查询
  • 网站备案完成通知书seo入门书籍
  • 广西城市建设学校手机官方网站排名seo公司
  • 网络营销广告词有哪些seo网站优化培
  • 建个静态网站枣庄网站seo
  • 怎么做网站竞价湖南网站建设营销推广
  • 做阿里巴巴的网站的费用吗百度宣传推广
  • 泰安市人民政府网站长沙百度快速优化排名
  • 慈溪想做网站的公司百度灰色关键词排名技术
  • 做批发比较好的网站有哪些整合营销名词解释
  • 网站制作的一般过程seo英文怎么读
  • java做的网站怎么突破搜索引擎seo优化
  • 课程网站怎么做百度数据中心
  • 徐州建站服务优化大师是什么
  • 微信网站建设哪家好百度发布
  • 网站城市跳转怎么做武汉seo诊断
  • 双语网站怎么做济南网站建设哪家专业
  • 做论坛推广的网站seo短期课程