Re: Problem with DATE
От | Vinayak |
---|---|
Тема | Re: Problem with DATE |
Дата | |
Msg-id | 1421123270940-5833702.post@n5.nabble.com обсуждение исходный текст |
Ответ на | Re: Problem with DATE (Dave Cramer <pg@fastcrypt.com>) |
Ответы |
Re: Problem with DATE
|
Список | pgsql-jdbc |
Hi Dave, The below example works fine using Oracle but in PostgreSQL it throws error for date type so we need to typecast that argument. Example: ps = conn.prepareStatement("SELECT ?, ?, ?,?"); ps.setObject(1, new String("1.2")); ps.setObject(2, new BigDecimal("1.2")); ps.setObject(3, new String("2014-01-11 33:22:11")); ps.setObject(4, Date.valueOf("2014-01-11")); I don't know whether to add PGDATE class is appropriate or not but if the above example works like Oracle in PostgreSQL then not necessary to change java code during migration from Oracle to PostgreSQL. Am I missing something? ----- Regards, Vinayak, -- View this message in context: http://postgresql.nabble.com/Problem-with-DATE-tp5833008p5833702.html Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.
В списке pgsql-jdbc по дате отправления: