Package efrei.ngo.entity

Examples of efrei.ngo.entity.MsgPiece


            event.setField("msg","Hello world");
            return event;
            */
          DatabaseAccess.connectToDB();
          ArrayList<MsgPiece> list=DatabaseAccess.dbCheckNewIM();
          MsgPiece msgT;
         
          if(list.size()==0){
            //DatabaseAccess.endConnectionToDB();
            return null;
          }else{
            Event event =Event.createDataEvent("/chat");
            for(int i=0,len=list.size();i<len;i++){
              msgT=list.get(i);
              event.setField("M"+i+"IDF",msgT.getpFrom());
              event.setField("M"+i+"MSG",msgT.getContent());
              event.setField("M"+i+"Time",msgT.getsTime().toString());
              event.setField("M"+i+"To", msgT.getpTo());
              event.setField("M"+i+"From", efrei.ngo.util.DatabaseAccess.dbGetNameViaID(msgT.getpFrom()));
            }
              //DatabaseAccess.endConnectionToDB();
              return event;
          }
        }
View Full Code Here


    ArrayList<MsgPiece> list=new ArrayList<MsgPiece>();
    try{
      Statement statement=conn.createStatement();
      String sql ="SELECT * FROM im WHERE isRead='f'";
      ResultSet rs=statement.executeQuery(sql);
      MsgPiece onePiece;
     
      while(rs.next()){
        onePiece=new MsgPiece(rs.getInt("id_im"), rs.getInt("pFrom"), rs.getInt("pTo"), rs.getString("content"), efrei.ngo.util.GeneralUnil.changeDateToGregorianCalendar(rs.getTime("sTime")));
        list.add(onePiece);
        dbUpdateIsReadMark(onePiece.getId_im());
      }
    }catch(Exception ex){
      ex.printStackTrace();
      return null;
    }
View Full Code Here

    int pFrom=Integer.parseInt(temp);
    int pTo=Integer.parseInt(request.getParameter("pTo"));
    String msg=request.getParameter("msg");
   
    JSONObject jObResponse=new JSONObject();
    MsgPiece onePiece=new MsgPiece(pFrom,pTo,msg);
   
    DatabaseAccess.connectToDB();
    try{
      if(DatabaseAccess.dbStoreIMIntoDB(onePiece)){
        jObResponse.accumulate("result", true);
View Full Code Here

TOP

Related Classes of efrei.ngo.entity.MsgPiece

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.