使用readCsvI()函数读取文件,使用RUN运行代码,数据读取不完,跳出方法,debug读取可以将数据全部读完
public static void readCsv(String csvPath) throws Exception {
oracleDruid dbConnect = new oracleDruid();
Connection connection = dbConnect.getConnect();
CsvReader csvReader = null;
int line = 0;
String TFT_Glass_ID="";
try {
csvReader = new CsvReader(csvPath, '^', Charset.forName("UTF-8"));
while (csvReader.readRecord()) {
System.out.print(csvReader.getRawRecord());
System.out.println();
line++;
if(line ==2 ) {
System.out.println(line);
String[] sumArrays = csvReader.getRawRecord().split("\^");
System.out.println(csvReader.getRawRecord());
for(int i=0;i
System.out.println(sumArrays[i]);
}
String GLS_INF=sumArrays[0];
String FIELD_COUNT=sumArrays[1];
String EQP_ID=sumArrays[2];
String Recipe_ID=sumArrays[3];
String CF_Glass_ID=sumArrays[4];
TFT_Glass_ID=sumArrays[5];
FileC3040.glassID=TFT_Glass_ID;
String SD=sumArrays[6];
String LC=sumArrays[7];
String VAS=sumArrays[8];
String UV=sumArrays[9];
String LC_VAS_TIME=sumArrays[10];
String VAS_UV_TIME=sumArrays[11];
String START_TIME=sumArrays[12];
String END_TIME=sumArrays[13];
String JUDGE=sumArrays[14];
//定义SQL
String sql = "insert into eds_yms_cell_glass_dry VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
PreparedStatement ps = connection.prepareStatement(sql);
ps.setString(1, GLS_INF);
ps.setString(2, FIELD_COUNT);
ps.setString(3, EQP_ID);
ps.setString(4, Recipe_ID);
ps.setString(5, CF_Glass_ID);
ps.setString(6, TFT_Glass_ID);
ps.setString(7, SD);
ps.setString(8, LC);
ps.setString(9, VAS);
ps.setString(10, UV);
ps.setString(11, LC_VAS_TIME);
ps.setString(12, VAS_UV_TIME);
ps.setString(13, START_TIME);
ps.setString(14, END_TIME);
ps.setString(15, JUDGE);
ps.executeUpdate();
ps.close();
}
if(line >=4) {
System.out.println(line);
String[] layerArrays = csvReader.getRawRecord().split("\\^");
for(int j=0;jSystem.out.println(layerArrays[j]);
}
String PNL_TYPE=layerArrays[1];
String Head=layerArrays[2];
String Panel_ID=layerArrays[3];
String INSPECT_PNT=layerArrays[4];
String INSPECT_VALUE=layerArrays[5];
String JUDGE=layerArrays[6];
Date date = new Date();
SimpleDateFormat dateFormat = new SimpleDateFormat("YYYYMMdd HHmmss");
String DATETIME = dateFormat.format(date.getTime());
//定义SQL
String sql = "insert into EDS_YMS_CELL_PNL_DRY_NEW1 VALUES (?,?,?,?,?,?,?,?)";
PreparedStatement ps = connection.prepareStatement(sql);
ps.setString(1, TFT_Glass_ID);
ps.setString(2, PNL_TYPE);
ps.setString(3, Head);
ps.setString(4, Panel_ID);
ps.setString(5, INSPECT_PNT);
ps.setString(6, INSPECT_VALUE);
ps.setString(7, JUDGE);
ps.setString(8, DATETIME);
ps.executeUpdate();
ps.close();
}
}
无报错
无
无