需求:有一个很大的txt文件(1,000,000条数据),从txt中读取有用数据库后保存到Oracle数据库中

利用Java实现:

1、加载文件后一行一行读取

2、数据库连接后按行插入到数据库

package com.test.IF.service;

import java.io.File;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException; import org.apache.commons.io.FileUtils;
import org.apache.commons.io.LineIterator; public class ReadCustomerFile { int idx;
Connection conn = null;
PreparedStatement pstmt = null; // 使用commons-io.jar包的FileUtils的类进行读取
public void readTxtFileByFileUtils(String fileName) {
File file = new File(fileName); dbConnection(); try {
LineIterator lineIterator = FileUtils.lineIterator(file, "GB2312");
while (lineIterator.hasNext()) {
String line = lineIterator.nextLine(); // 行数据转换成数组
String[] custArray = line.split("\\|");
insertCustInfo(custArray);
Thread.sleep(10);
}
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
} finally {
dbDisConnection();
}
} // 插入到数据库中
public void insertCustInfo(String[] strArray) {
try {
StringBuffer sqlBf = new StringBuffer();
sqlBf.setLength(0); sqlBf.append("INSERT INTO TEMP_CUST_INFO(CUST_NO, CUST_NM, MOB_NO1) \n");
sqlBf.append(" VALUES(? \n");
sqlBf.append(" , ? \n");
sqlBf.append(" , ?) \n"); pstmt = conn.prepareStatement(sqlBf.toString());
idx = 1;
pstmt.clearParameters();
pstmt.setInt(idx++, Integer.parseInt(strArray[0]));
pstmt.setString(idx++, strArray[1]);
pstmt.setString(idx++, strArray[2]); pstmt.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
} finally {
if (pstmt != null) {
try {
pstmt.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
} // 连接数据库
public Connection dbConnection() {
try {
Class.forName("oracle.jdbc.driver.OracleDriver"); String url = "jdbc:oracle:thin:@127.0.0.1:1521:orcl";
String user = "scott";
String password = "goodluck"; conn = DriverManager.getConnection(url, user, password);
System.out.println("Connection 开启!");
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
} return conn;
} // 关闭数据库
public void dbDisConnection() {
if (conn != null) {
try {
conn.close();
System.out.println("Connection 关闭!");
} catch (SQLException e) {
e.printStackTrace();
}
}
} public static void main(String[] args) {
ReadCustomerFile rcf = new ReadCustomerFile();
rcf.readTxtFileByFileUtils("D:\\test\\customer_info.txt");
}
}

确认数据库数据:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAATAAAAGcCAIAAADRR2sxAAAgAElEQVR4nO2dMY7cRhOF5zwODEUT7BEUGnA+0QAbO9EFjEkXjv5Q+SSK1oAjXsCbOdpQF5gb8A9mSDa7XzfZpRVZr7o+/MBvUdpWva5+JIecfjp8/fq17/vbh/L8/Pz8/PzPf//S/e/79+8fPhtb8vz8TF2/DBuqn5+fv379enBDuiHZsaHaDemGNIIN1W5IN6QRbKh2Q7ohjWBDtRvSDWkEG6rdkG5II9hQvYMhv3759TDwy5dv//z9xy+//zX+7p+///r8d/THfvvzv3///P0wI/iRf/7795///vo8O/jt+dNvf07/PfzUpz++/oAh3y7H8e8/Xt5ub5fj6Tr+7vV0vLxFf+x0vd2up3nlwY88fm52cBw0Oj6OHP88nPmk/sXRgqofOm6z2sFfm6s8N9rwM8sKJOhVPY63QvjWhvzz98RL0JD/+w2a5+uXX3/58g256K/Pn377/Olh5sCQ354/HaYfyQy7xpBgJUFDXk/REhz/LDp8/7nTafrN0JDHY/gXPPotNmRhtLfLcb4gH78ITzJp+bnK86MdDqfTaVtD7q16WiT5JTBXsaEh//7jl9QPOUPG18AlQx5++3Py22DIZJw/fz98/l+9IeFk5gyJFlzJkIfTdVoNoSFPl/BvuJ6Ol8ua5ZxZmvnRkpqv429MXkr/3kzl2dHSX3wkqlVnjkAV2xkS26l4yxqZZ8GQk98ehkz/fH6EkiGxnYq3rOnVtGTIqVszQ16DH7uejpe3Vcs5tzRzo6W1DUemmzf0t+LK86OFP/TxqFYd/OCiCqWGnG5xg4vqoiGHi/Cehhx+OfsgsWjI4U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I6A4tmvzcQ50xU6ccclUefAMqDKk15Eowh1lDNhJyFd6nwntW5YYM41yihQoX9PqQq/LgG7BsSPUhV4I5LBhyeMAz/qUWQ64e18f0wqnRkIWUp+XXHsMQ60OuSoNvAH4BgCtUG3JVPYdFQzYRchX86x7aX3vUkXnK+nhC4CFXOrGhuqEvBqyHvbXs9cuwodoNCWBvLXv9MmyodkMC2FvLXr8MG6rdkAD21rLXL8OGajckgL217PXLsKG685Arx1GFh1zFdOTnWvb6ZdhQ3fktawp7a9nrl2FDtRsSwN5a9vpl2FDthgSwt5a9fhk2VLshAeytZa9fhg3VbkgAe2vZ65dhQ3VDhsxlKC0mBvxIyJWexADekKsfSAxoNeRKfWJAkqGUZjoF4HPt+pCr4uAbAJcmWchV/RwC1W2FXF1PQ1AA3A6pypB935c2pJc3KNeGXJUH34DcCYUo5Eowh+g01FLIVZQYoHuDct/38Q7yKNMpJDHkrIF4cawefAPWGFJ7yFX9HGJDzq74pg0ZXCHD8AASQwafYsZoh5HkM2QQ+BCBT/WlwTeg7gqpNOSqeg5zhmwn5GoMETieTmxXyNnheO5zD3Xu59vzUshVefANqDCk1pCrtJ561cQhV/8HcbrNYBBvAHAAAAAASUVORK5CYII=" alt="" />

Java 读取txt文件,读取结果保存到数据库的更多相关文章

  1. Java 读取txt文件生成Word文档

    本文将以Java程序代码为例介绍如何读取txt文件中的内容,生成Word文档.在编辑代码前,可参考如下代码环境进行配置: IntelliJ IDEA Free Spire.Doc for Java T ...

  2. Java读取txt文件

    package com.loongtao.general.crawler.slave.utils; import java.io.BufferedReader; import java.io.File ...

  3. java 读取TXT文件的方法

    java读取txt文件内容.可以作如下理解: 首先获得一个文件句柄.File file = new File(); file即为文件句柄.两人之间连通电话网络了.接下来可以开始打电话了. 通过这条线路 ...

  4. java读取TXT文件的方法

    java读取txt文件内容.可以作如下理解: 首先获得一个文件句柄.File file = new File(); file即为文件句柄.两人之间连通电话网络了.接下来可以开始打电话了. 通过这条线路 ...

  5. java读取txt文件内容

    package read; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; public ...

  6. Java中读取txt文件中中文字符时,出现乱码的解决办法

    这是我写的一个Java课程作业时,遇到的问题. 问题描述: 我要实现的就是将txt文件中的内容按一定格式读取出来后,存放在相应的数组. 我刚开始运行时发现,英文可以实现,但是中文字符就是各种乱码. 最 ...

  7. java读取txt文件的2中方法---并将内容(每一行以固定的字符分割切成2段)存到map中去

    #java读取txt文件的第一种方法 /** * 方法:readTxt * 功能:读取txt文件并把txt文件的内容---每一行作为一个字符串加入到List中去 * 参数:txt文件的地址 * 返回: ...

  8. Java读取txt文件信息并操作。

    一.java读取txt文件内容 import java.io.BufferedInputStream; import java.io.BufferedReader; import java.io.Fi ...

  9. react FileReader读取TXT文件并保存 split切割字符串 map()分别渲染切割后的数组内的所有字符串

    //class my_fileReader( e ) {         console.log(e.target.files[0]);         const reader = new File ...

  10. Java 读取TXT文件的多种方式

    1).按行读取TXT文件package zc;import java.io.BufferedReader;import java.io.File;import java.io.FileNotFound ...

随机推荐

  1. C++ async task

    最近在搞Android 开发,里面多线程的使用比较频繁,java多线程接口很方便. Thread, AysncTask, Handler 这些接口比起posix提供的pthread_create()等 ...

  2. Android学习笔记之使用百度地图实现地图控制

    PS:吾之荣耀,离别已久. 学习内容: 1.实现地图控制. 2.百度地图开发的一些细节     1.实现地图控制:   这一篇主要写在百度地图上添加一些其他控制.上一篇书写了覆盖物的添加,地理编码和反 ...

  3. Scrum 项目 7.0

    ------------------7.0------------------------------ Sprint回顾 1.回顾组织 主题:“我们怎样才能在下个sprint中做的更好?” 时间:设定 ...

  4. jquery选择器(原创)<二>

    jquery选择器,选择接着学: 前面学习了基本选择器中的CSS选择器,现在学层级选择器: 1.子元素选择器 子元素选择器,用于在给定的父元素下,查找这个父元素下面的所有的子元素,语法格式,如下: $ ...

  5. thread_CyclicBarrier回环栅栏

    CyclicBarrier回环栅栏,字面意思是可循环使用(Cyclic)的屏障(Barrier).通过它可以实现让一组线程等待至某个状态之后再全部同时执行. 它要做的事情是,让一组线程到达一个屏障(也 ...

  6. Netty学习之服务器端创建

    一.服务器端开发时序图 图片来源:Netty权威指南(第2版) 二.Netty服务器端开发步骤 使用Netty进行服务器端开发主要有以下几个步骤: 1.创建ServerBootstrap实例 Serv ...

  7. 【Android】将Xamarin For VS升级为4.1.0.530版

    分类:C#.Android.VS2015(自带Update2).Win10 创建日期:2016-06-10 2016-08-03说明:该版本已过时,新版本详见本博客置顶的更新. 一.Xamarin f ...

  8. sqlsever备份,还原和导入导出方法

    一:sqlsever数据库的几种备份和还原方法: 第一种:备份还原方法 1.选择要备份的数据库-任务-备份- 打开之后会看到里面有: 常规:在常规页面中我们可以看到:右下角位置有一个可以更改存储(备份 ...

  9. JPA学习(2)注解

    上一篇学习了JPA的helloworld,也初略的使用了一些注解,接下来就细细的了解一下有哪些注解,和这些注解的作用 JPA的基本注解: ①@Entity,@Table,@Id,@GeneratedV ...

  10. 数组json格式的字符串 转 list<Bean>

    1.  字符串形式: [ { "userid": "admin", "name": "admin", "pas ...