//批量调用存储过程
public int[] impCdrinterimday(Vector<String> filename){
Connection conn=null;
if(filename==null){
return null;
}
CallableStatement proc = null;
conn=getConnection();
int[] updateCount= null;
try {
conn.setAutoCommit(false);
proc=conn.prepareCall("{ call PG_SPILT_BASIC.cp_ct_cdr_interim_spilt_f(?,?)}");
for(String f: filename){
log.warn((++i)+" "+f+" "+Thread.currentThread().getName());
proc.setString(1, f);
proc.setInt(2, i);
proc.addBatch();
}
updateCount= proc.executeBatch();
conn.commit();
conn.setAutoCommit(true);
proc.clearBatch();
close(conn,proc);
} catch (SQLException e) {
try {
conn.rollback();
} catch (SQLException e1) {
log.error(e1.toString(),e1.fillInStackTrace());
}
log.error(e.toString(),e.fillInStackTrace());
}
return updateCount;
}
//批量执行sql
public int[] updateendmailList(Vector<SendmailListVO> vector) throws SQLException{
//批量执行sql
int[] result=null;
Connection conn=null;
PreparedStatement ps=null;
String sql="update ct_sendmaillist_new t set t.NUMSENDFLAG=1 where t.NUMMAILLISTGUID=?";
conn=getConnection();
ps=conn.prepareStatement(sql);
for(SendmailListVO vo:vector){
ps.setLong(1, vo.getNummaillistguid());
ps.addBatch();
}
result=ps.executeBatch();
close(conn, ps);
return result;
}
public int[] impCdrinterimday(Vector<String> filename){
Connection conn=null;
if(filename==null){
return null;
}
CallableStatement proc = null;
conn=getConnection();
int[] updateCount= null;
try {
conn.setAutoCommit(false);
proc=conn.prepareCall("{ call PG_SPILT_BASIC.cp_ct_cdr_interim_spilt_f(?,?)}");
for(String f: filename){
log.warn((++i)+" "+f+" "+Thread.currentThread().getName());
proc.setString(1, f);
proc.setInt(2, i);
proc.addBatch();
}
updateCount= proc.executeBatch();
conn.commit();
conn.setAutoCommit(true);
proc.clearBatch();
close(conn,proc);
} catch (SQLException e) {
try {
conn.rollback();
} catch (SQLException e1) {
log.error(e1.toString(),e1.fillInStackTrace());
}
log.error(e.toString(),e.fillInStackTrace());
}
return updateCount;
}
//批量执行sql
public int[] updateendmailList(Vector<SendmailListVO> vector) throws SQLException{
//批量执行sql
int[] result=null;
Connection conn=null;
PreparedStatement ps=null;
String sql="update ct_sendmaillist_new t set t.NUMSENDFLAG=1 where t.NUMMAILLISTGUID=?";
conn=getConnection();
ps=conn.prepareStatement(sql);
for(SendmailListVO vo:vector){
ps.setLong(1, vo.getNummaillistguid());
ps.addBatch();
}
result=ps.executeBatch();
close(conn, ps);
return result;
}