package com.egf.qingbao;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
/**
* @author xh
* @version $Revision: 1.1 $
* @since 0.1
*/
public class CopyOfReadTxtutil {
private static Connection conn = null;
public static void readTxtFile(String filePath) {
conn = JdbcUtil.getConnection("oracle.jdbc.driver.OracleDriver",
"jdbc:oracle:thin:@xxx.x.x.xxx:1521:tjkf", "ypxx", "ypxx");
PreparedStatement pre = null;
String sql = "insert into yp_tldp values(SEQ_YP_TLDP.nextval,?,?,?,?,?,?,?,?,?,?,?)";
String encoding = "UTF-8";
long startTime = System.currentTimeMillis();
File file = new File(filePath);
if (file.isFile() && file.exists()) {
InputStreamReader read = null;
try {
read = new InputStreamReader(new FileInputStream(file),
encoding);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
BufferedReader bufferedReader = new BufferedReader(read); <
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
/**
* @author xh
* @version $Revision: 1.1 $
* @since 0.1
*/
public class CopyOfReadTxtutil {
private static Connection conn = null;
public static void readTxtFile(String filePath) {
conn = JdbcUtil.getConnection("oracle.jdbc.driver.OracleDriver",
"jdbc:oracle:thin:@xxx.x.x.xxx:1521:tjkf", "ypxx", "ypxx");
PreparedStatement pre = null;
String sql = "insert into yp_tldp values(SEQ_YP_TLDP.nextval,?,?,?,?,?,?,?,?,?,?,?)";
String encoding = "UTF-8";
long startTime = System.currentTimeMillis();
File file = new File(filePath);
if (file.isFile() && file.exists()) {
InputStreamReader read = null;
try {
read = new InputStreamReader(new FileInputStream(file),
encoding);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
BufferedReader bufferedReader = new BufferedReader(read); <