读取文本.EFZ文件数据,存入数据库
来源:互联网 发布:informix sql 语法 编辑:程序博客网 时间:2024/05/22 12:45
9.13-9.14小任务
编写Java程序,将AI201608271800.EFZ文件进行解析,并将解析后的数据进行入库(入至Oracle中):
主要技术点:读取.efz文件并每俩行取一次数据存入数据库。
public static void main(String[] args) throws IOException { System.out.println("数据扫描插入中---------"); AtmosphereDao atd = new AtmosphereDao(); File file = new File("e:/AI201608271800.EFZ"); FileReader fr = new FileReader(file); BufferedReader in = new BufferedReader(fr); String line; int count = 1; int sum = 0, n = 0; String[] str1= {}; String[] str2= {}; while ((line = in.readLine()) != null) { if (count % 3 == 1) { str1 = line.split(" "); } else if (count % 3 == 2) { str2 = line.split(" "); } else if (count % 3 == 0) {Atmosphere asp = new Atmosphere(str1[0],Integer.parseInt(str1[1]) ,Integer.parseInt(str1[2]),str1[3] , str1[4], Integer.parseInt(str1[5]),str2[0], str2[1], str2[2],str2[3], str2[4], str2[5], str2[6], str2[7], str2[8], str2[9], str2[10], str2[11], str2[12], str2[13],str2[14], str2[15], str2[16], str2[17], str2[18], str2[19], str2[20], str2[21], str2[22], str2[23], str2[24],str2[25], str2[26], str2[27], str2[28], str2[29], str2[30], str2[31], str2[32], str2[33], str2[34], str2[35],str2[36], str2[37], str2[38], str2[39], str2[40], str2[41], str2[42], str2[43], str2[44], str2[45], str2[46],str2[47], str2[48], str2[49], str2[50], str2[51]); n = atd.InsertAll(asp); sum += n; System.out.println("插入第" + sum + "条数据"); } count++; } System.out.println("数据插入完毕"); in.close(); }
阅读全文
0 0
- 读取文本.EFZ文件数据,存入数据库
- 读取Excel表格数据存入mongodb数据库
- mybatis读取数据库数据,存入Map
- java读取 xls 文件 存入数据库
- 文件在数据库中的存入及读取
- 上传Excel文件并读取存入数据库
- MYSQL存储过程在XML文本信息中读取数据节点信息,将节点中的数据存入数据库
- PHP文件上传数据存入数据库
- jdbc读取数据库文本数据
- 二进制存入读取数据库
- 关于数据的归档存入文件和读取文件
- c语言链表数据存入文件和读取文件
- c#读取excel数据,同时存入mysql数据库
- 从Form中textBox中读取数据存入数据库
- Delphi从Excel读取数据存入数据库Demo
- asp.net关于文件在数据库的存入和读取
- asp.net关于文件在数据库的存入和读取
- 上传excel文件并在服务器端读取存入数据库
- Schlumberger.Visual.MODFLOW.Flex.2015.1.Win32_64 2CD
- sun.security.action.GetPropertyAction
- MVC模式到底是个什么
- springmvc+jsp/html 前后台交互(三):controller和html页面交互
- Navicat Premium 操作Oracle新建用户,表空间,建表
- 读取文本.EFZ文件数据,存入数据库
- cvs added independently by second party Error, CVS operation failed
- ios Temporary exceptions can be configured via your app's info.plist file
- c++-algorithm 头文件排序sort
- 常见数据结构与算法整理总结(下)
- CSS图片阴影+鼠标移上图片放大、变形
- python中利用re模块使用正则表达式
- VC6.0 C语言精华代码
- 多线程的三种建立方式