private generalUser generalUser;
public String execute() {
try {
java.sql.Date regTime = new java.sql.Date(new java.util.Date()
.getTime());
java.sql.Date editTime=regTime;
generalUser.setRegTime(regTime)
GeneralUserDaoImpl generalUserDaoImpl = new GeneralUserDaoImpl();
if (generalUserDaoImpl.save(generalUser)) {
return SUCCESS;
} else {
return ERROR;
}
} catch (Exception e) {
e.printStackTrace();
return ERROR;
}
}
可不可以generalUser.setRegTime(regTime)
------解决方案--------------------
java.sql.Date 要转成java.util.Date
------解决方案--------------------
java.util.Date
generalUser.setRegTime(new Date());
------解决方案--------------------
java.util.Date
generalUser.setRegTime(new Date());