Vinayak wrote:
> Hi,
> I tried to use setDate() instead of setObject() but still it gives the same
> error.
> Example:
> ps = conn.prepareStatement("SELECT ?");
> java.sql.Date sqlDate1 = new java.sql.Date(new java.util.Date().getTime());
> ps.setDate(6, sqlDate1);
That will not work has you said and is not the same code you demostrated.
Use the Oracle TO_DATE('db_date_content', 'YYYY-MM-dd') to collect
the correct formatted date string from the existing source database,
oracleDateString = SELECT TO_DATE(SELECT dateField, 'YYYY-MM-dd')
Use dateValue = java.sql.Date.valueOf(oracleDateString), and
prepared_sqlStatement.setDate(i++, dateValue)
to set the date in PostgreSQL database.
danap.