Paul Clapham wrote:You should bear in mind that we don't know what your PreparedStatement looks like. And that we don't know anything about this table and what type of column you're trying to use. (Actually, not true: we know it's in an Oracle database.)
So absent that useful information I would suggest you try to insert it only in a column which is set up to receive timestamp information. And don't write SQL which tries to convert it to some other format; let the database driver take care of formatting.
What should I do in order to get the dateTime 2009-10-10 12:11:51.140 inserted into another table?
on the inserting table the datatype is DATE, inserting into a Oracle 10.0.2.0.1 database table.
on the retrieving table is a sqlserver and the datatype is datetime, the data is like 2009-10-10 12:11:51.140
I have changedto Stmt.setString(1, rs.getString("date")); However, I got an error as
ORA-01861: literal does not match format string
Thanks