日期:2014-05-18 浏览次数:20736 次
private void updateSms() {
Log.getInstance().printInfo("", "正在更新");
Connection conn = null;
Statement stat = null;
ResultSet rsRecord = null;
//全部
ResultSet rsMoSmsAll = null;
int nArg = 0;
int nArg1 = 0;
int nArg2 = 0;
String ctrl=null;
try {
conn = DataBaseManage.getInstance().getConnection();
stat = conn.createStatement();
conn.setAutoCommit(false);
rsRecord = stat.executeQuery( "select SendID from table_a where Flag=1" );
while (rsRecord.next()) {
nArg = stat.executeUpdate( "update table_b set PushStatus = 5 " +"where SendID='"+rsRecord.getString(1)+"'" );
rsMoSmsAll=stat.executeQuery( "select Number from table_b " +"where SendID='"+rsRecord.getString(1)+"' and PushStatus=5" );
}
conn.commit();
} catch (Exception e) {
ExceptionHeading.getException(this.getClass().getName(), e);
}finally{
try {
rsRecord.close();
rsMoSmsAll.close();
stat.close();
conn.close();
} catch (SQLException e) {
ExceptionHeading.getException(this.getClass().getName(), e);
}
}
}
if (rsMoSmsAll != null) {
rsMoSmsAll.close();
}