while(true){                   //采用无限循环的方式
-------------------------------------------------------
好像没有出口呀

解决方案 »

  1.   


    在上面得到mo_table记录函数:public Mo_total_table getMoMsg()中返回值是不是有问题呢?因为我把主函数该为:
    /*主函数*/
    public static void main(String[] args)throws Exception{
        connectionDB = new ConnectionData();   //连接数据库
        Chat_mothed mothed = new Chat_mothed();//构建方法类
           while(true){                   //采用无限循环的方式
              moMsg = mothed.getMoMsg(connectionDB);//取信息记录
              while(moMsg!=null){
              System.out.print(moMsg.msgcontent);  //打印内容
              int id = moMsg.id;                   //取得该信息id
              mothed.flagMo(id, connectionDB);     //修改标志
            }
        }
      }
    这时程序没有动静,不打印内容,如果将while(moMsg!=null)该为while(!moMsg.equals(null)){--}时,得到的是空指针的异常。
    我该怎么该呀?
      

  2.   

    郁闷,不习惯you的代码方式,不看了