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);
Error'd: Bridge for Sale
-
"Scammer offers to buy Google" is certainly a new twist on a very old New
York con. *Jan B.* explains "Scammers have found a new way to steal money,
scra...
4 days ago
No comments:
Post a Comment