81,094
社区成员
发帖
与我相关
我的任务
分享
private Date cdate;
public Date getCdate() {
return cdate;
}
public void setCdate(Date cdate) {
this.cdate = cdate;
}
public boolean doCreate(CProduct cp) throws Exception {
// TODO Auto-generated method stub
boolean flag = false;
String sql="insert into cproduct (ctype,ccount,cdate) values (?,?,?)";
PreparedStatement pstm = this.dbc.getConnection().prepareStatement(sql);
pstm.setString(1, cp.getCtype());
pstm.setInt(2, cp.getCcount());
pstm.setTimestamp(3, new Timestamp(cp.getCdate().getTime()));
int count = pstm.executeUpdate();
if(count>0){
flag=true;
}
return flag;
}