mycon.setAutoCommit(false);
pstat=mycon.prepareStatement("insert into zzb(brno,kmh,bz,date1,brno1,name,lyd,lyc,lmd,lmc,ldd,ldc,tfd,tfc,tdd,tdc,byrj,bjrj,bnrj) values(?,?,?,to_date(?,'yyyymmdd'),?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
...
while(Line != null) { //判断读取到的字串是否不等于null
...
pstat.setString(1,brno);
pstat.setString(2,kmh);
...
pstat.addBatch();
Line = br.readLine(); //自文件读取一行数据
}//end of while
pstat.executeBatch();
mycon.commit();
pstat=mycon.prepareStatement("insert into zzb(brno,kmh,bz,date1,brno1,name,lyd,lyc,lmd,lmc,ldd,ldc,tfd,tfc,tdd,tdc,byrj,bjrj,bnrj) values(?,?,?,to_date(?,'yyyymmdd'),?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
...
while(Line != null) { //判断读取到的字串是否不等于null
...
pstat.setString(1,brno);
pstat.setString(2,kmh);
...
pstat.addBatch();
Line = br.readLine(); //自文件读取一行数据
}//end of while
pstat.executeBatch();
mycon.commit();
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货