日期:2014-05-17  浏览次数:20948 次

新手求教!!!!
oracle数据库中的表fund的各数据类型 (时间数据类型是用date还是datetime?)
create table fund(
 fund_no  int primary key,
 fund_name  varchar2(40) not null,
 fund_price number(6,3) not null,
 fund_desc  varchar2(100),
 fund_status char(1) not null,
 create_date date not null,
 oper_code char(4) not null,
 constraint FK_FUND_OPERATOR FOREIGN KEY (oper_code) references operator,
 constraint UK_FUND UNIQUE (fund_name)   
);
还有在jsp中的,sql插入语句应该如何写,
private static final String SQL_ADD =
 "insert into fund values(seq_fund.nextval,?,?,?,?,?[此处的时间应该如何写?],?)";

前提:在fund_input表单提交页面未传递fund_no与create_date参数,应该时间是要用什么函数来获取吧,求教!!!!
oracle与jsp的问题求教!!!

------解决方案--------------------
//将系统时间作为插入时间,需要转换
long nowtime=new Date().getTime();
java.sql.Date billDate=new java.sql.Date(nowtime);