中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁 > news >正文

丹陽市制作網(wǎng)站南昌網(wǎng)站建設(shè)

丹陽市制作網(wǎng)站,南昌網(wǎng)站建設(shè),網(wǎng)站制作公司昆明,北京建網(wǎng)站價格優(yōu)幫云基于Java實(shí)現(xiàn)DBase DBF文件的解析和顯示 JDK19編譯運(yùn)行,實(shí)現(xiàn)了數(shù)據(jù)庫字段和數(shù)據(jù)解析顯示。 首先解析數(shù)據(jù)庫文件頭代碼 byte bytes[] Files.readAllBytes(Paths.get(file));BinaryBufferArray bis new BinaryBufferArray(bytes);DBF dbf new DBF();dbf.VersionN…

基于Java實(shí)現(xiàn)DBase DBF文件的解析和顯示

JDK19編譯運(yùn)行,實(shí)現(xiàn)了數(shù)據(jù)庫字段和數(shù)據(jù)解析顯示。

首先解析數(shù)據(jù)庫文件頭代碼

		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();		// 記錄數(shù)量dbf.LengthOfHeaderStructure = bis.ReadUInt16();	// 文件頭長(內(nèi)容開始位置)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) 	// 是否結(jié)束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;}

解析數(shù)據(jù)代碼:

		dbf.resultset = new Vector<Map<String, Object>>();	//結(jié)果集for (int i=0; i<dbf.NumberOfRecords-1; i++) {char delete = '\0';		delete = bis.ReadAsciiChar();	// 讀入刪除標(biāo)記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://m.risenshineclean.com/news/58889.html

相關(guān)文章:

  • 政府網(wǎng)站建設(shè)的創(chuàng)新機(jī)制企業(yè)網(wǎng)絡(luò)營銷
  • 無錫做網(wǎng)站品牌公司萬網(wǎng)注冊域名查詢官方網(wǎng)站
  • 做網(wǎng)站設(shè)計(jì)制作的公司口碑營銷案例2022
  • 做c語言的題目的網(wǎng)站移動廣告平臺
  • 域名有了主機(jī)有了如何做網(wǎng)站已備案域名30元
  • 哪里有專做水果的網(wǎng)站怎么建立網(wǎng)站?
  • 如何建立一個手機(jī)網(wǎng)站nba新聞最新消息滾動
  • 深圳有做網(wǎng)站的公司嗎seo 關(guān)鍵詞優(yōu)化
  • 網(wǎng)站備案照片人民網(wǎng) 疫情
  • 長春建站優(yōu)化加徽信xiala5百度網(wǎng)址怎么輸入?
  • 從音樂網(wǎng)站下載歌曲做鈴音要收費(fèi)嗎最新軍事消息
  • 菏澤公司做網(wǎng)站深圳seo優(yōu)化培訓(xùn)
  • 網(wǎng)站算陣地建設(shè)谷歌瀏覽器網(wǎng)頁版入口在哪里
  • 以做網(wǎng)站為畢設(shè)挖掘關(guān)鍵詞的工具
  • 化妝培訓(xùn)網(wǎng)站 源碼做優(yōu)化的網(wǎng)站
  • 在線網(wǎng)站設(shè)計(jì)網(wǎng)絡(luò)推廣公司有哪些
  • 做IT的會做網(wǎng)站嗎權(quán)重查詢愛站網(wǎng)
  • linux打包網(wǎng)站做備份網(wǎng)絡(luò)營銷產(chǎn)品策略的內(nèi)容
  • 深圳做網(wǎng)站建設(shè)比較好的公司濟(jì)南網(wǎng)站seo優(yōu)化
  • wordpress 自建網(wǎng)站seo百度快速排名
  • 九江做網(wǎng)站廈門網(wǎng)絡(luò)推廣外包多少錢
  • 邢臺網(wǎng)站建設(shè)包括哪些專業(yè)北京seo公司
  • 中企動力做的家具行業(yè)網(wǎng)站企業(yè)網(wǎng)絡(luò)營銷策劃書范文
  • 12免費(fèi)建站網(wǎng)站百度關(guān)鍵詞搜索熱度查詢
  • 石城網(wǎng)站建設(shè)東莞有限公司seo
  • 長春火車站到吉大二院網(wǎng)絡(luò)營銷措施有哪些
  • 網(wǎng)站建設(shè)頁面頁腳怎么設(shè)置b站推廣2024mmm已更新
  • 阿里云服務(wù)器做電影網(wǎng)站嗎在線培訓(xùn)管理系統(tǒng)
  • 招聘網(wǎng)站做沙龍如何在百度上做產(chǎn)品推廣
  • ipad 建網(wǎng)站免費(fèi)搜索引擎入口