Oracle to_date()
select db_fieldname from db_table where db_timestamp_field = to_date(?, 'dd-mm-yyyy');
replace the to_date(?, 'dd-mm-yyyy') function with a ?
select db_fieldname from db_table where db_timestamp_field = ?;
then using
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
Timestamp result = new Timestamp(sdf.parse(inputdate,new ParsePosition(0)).getTime());
prepareStatement.setTimeStamp(1,result);
Oracle to_char()
select * from table where to_char(db_timestamp_field, 'dd-mm-yyyy') = ?;
replace to_char(db_timestamp_field,'dd-mm-yyyy') with trunc(db_timestamp_field)
select * from table where trunc(db_timestamp_field) = ?;
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
Date javaDate = sdf.parse(inputdate);
java.sql.Date sqlDate = new java.sql.Date(javaDate.getTime());
prepareStatement.setDate(1,sqlDate);
Turning Thirty
-
*Eric O* worked for a medical device company. The medical device industry
moves slowly, relative to other technical industries. Medical science and
safet...
7 hours ago
No comments:
Post a Comment