写程序时怎样将java中的date类型转换成oracle数据库中对应的date类型
------解决方案--------------------------------------------------------
如果oracle中字段是DATA类型的,
在javabean中:持久化时会自动对应
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "DOWN_TIME")
public Date getDownTime() {
return this.downTime;
}
public void setDownTime(Date downTime) {
this.downTime = downTime;
}
在hibernate中:
String addressSql = "insert into ks_sales_info_rep(id,insertdate) values (?,to_date(?, 'yyyy-MM-dd'))";