SQL一:
sql = " update t_receive_user set user_email = ?, user_name = ?, user_tel = ?, update_timestamp = ? , note = ? " +
" where user_sid = ? ";
connection = getDataSource().getConnection();
ps = connection.prepareStatement(sql);
ps.setObject(1,tReceiveUser.getUserEmail());
ps.setObject(2,tReceiveUser.getUserName());
ps.setObject(3,tReceiveUser.getUserTel());
ps.setObject(4,Time.getCurrentTime()/1000);
ps.setObject(5,tReceiveUser.getNote());
ps.setObject(6,tReceiveUser.getUserSid());
System.out.println(ps.execute());
SQL二:
sql = " delete t_receive_user where user_sid = ? ";
connection = getDataSource().getConnection();
ps = connection.prepareStatement(sql);
ps.setObject(1,tReceiveUser.getUserSid());
System.out.println(ps.execute());
SQL三:
sql = "INSERT t_receive_user (user_email,user_name,user_tel,update_timestamp,note)" +
" values (?,?,?,?,?)";
ps = connection.prepareStatement(sql);
ps.setObject(1,tReceiveUser.getUserEmail());
ps.setObject(2,tReceiveUser.getUserName());
ps.setObject(3,tReceiveUser.getUserTel());
ps.setObject(4,Time.getCurrentTime()/1000);
ps.setObject(5,tReceiveUser.getNote());
System.out.println(ps.execute());