Пример #1
0
 @Override
 public int add(Device t) throws SQLException {
   return qr.update(
       "insert into client(ap_id,kind,ip,mac,token,outgoing,incoming,uprate,downrate,status,login_count,update_time,login_time) values(?,?,?,?,?,?,?,?,?,?,?,?,?)",
       new Object[] {
         t.getAp_id(),
         t.getKind(),
         t.getIp(),
         t.getMac(),
         t.getToken(),
         t.getOutgoing(),
         t.getIncoming(),
         t.getUprate(),
         t.getDownrate(),
         t.getStatus(),
         t.getLogin_count(),
         t.getUpdate_time(),
         t.getLogin_time()
       });
 }
Пример #2
0
 public void update(Device device, String token) throws SQLException {
   qr.update(
       "update client set token=? where ap_id =? and mac=?",
       new Object[] {token, device.getAp_id(), device.getMac()});
 }