How to insert custom date time in oracle using java?

Posted by shree on Stack Overflow See other posts from Stack Overflow or by shree
Published on 2012-10-26T04:38:27Z Indexed on 2012/10/26 5:01 UTC
Read the original article Hit count: 222

Filed under:
|
|

Hi i have a column (type date).I want to insert custom date and time without using Preparedstatement .i have used

String date = sf.format(Calendar.getInstance().getTime());
String query = "Insert into entryTbl(name, joinedDate, ..etc)  values ("abc", to_date(date, 'yyyy/mm/dd HH:mm:ss'))";
statement.executeUpdate(query);

but am getting literal doesnot match error. so even tried with "SYSDATE".Its inserting only date not time.So how to insert the datetime using java into oracle?please any one help..

© Stack Overflow or respective owner

Related posts about java

Related posts about Oracle