public class OracleSendMsgThread implements Runnable{
public void run() {
try{
while(true){
List<MessageToSent> messageToSentList=new MessageToSentDAO().getMessageToSentListByZT("0");
if(messageToSentList!=null){
for(int i=0;i<messageToSentList.size();i++){
MessageToSent mts=messageToSentList.get(i);
Connection conn=ConnectDB.getSqlServerConnection();
Statement st=conn.createStatement();
String sendTime="";
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
sendTime=sdf.format(new Date()).toString();
st=new TblSmsSendDAO().add(st,new TblSmsSend(mts.getSjhm().trim(),sendTime,mts.getDfnr(),0));
if(st.executeBatch().length>0)
{
new MessageToSentDAO().updateMessageToSentZT(mts.getMsgId());
}
st.close();
conn.close();
}
}//end if