Dear All,
I have one doubt for how to insert the java.sql.Date into ms-sql server.
I tried the below code but it couldn't be inserted. I did wrong in
my code that is ps.setDate(1,fu ll_date_time) to ps.setString(1, full_date_time) ;
How can i covert the String(full_dat e_time) to java.sql.Date() and insert the MM/DD/YYYY format in ms-sql database?
I set datetime as datatype in my products table.
<%
SimpleDateForma t sdf=new SimpleDateForma t("MM/dd/yyyy hh:mm:ss a");
Date d=new Date();
String full_date_time= sdf.format(d).t rim();
out.println("Da te--------"+full_date_tim e);
ps = con.prepareStat ement("insert into products values(?)");
ps.setDate(1,pr oduct_id);
ps.executeUpdat e();
%>
thanks in advance
V. Prasath.
I have one doubt for how to insert the java.sql.Date into ms-sql server.
I tried the below code but it couldn't be inserted. I did wrong in
my code that is ps.setDate(1,fu ll_date_time) to ps.setString(1, full_date_time) ;
How can i covert the String(full_dat e_time) to java.sql.Date() and insert the MM/DD/YYYY format in ms-sql database?
I set datetime as datatype in my products table.
<%
SimpleDateForma t sdf=new SimpleDateForma t("MM/dd/yyyy hh:mm:ss a");
Date d=new Date();
String full_date_time= sdf.format(d).t rim();
out.println("Da te--------"+full_date_tim e);
ps = con.prepareStat ement("insert into products values(?)");
ps.setDate(1,pr oduct_id);
ps.executeUpdat e();
%>
thanks in advance
V. Prasath.
Comment