Using a preparedStatement containing Oracle's to_date

From: dazeconf(at)yahoo(dot)com (Jeremy)
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Using a preparedStatement containing Oracle's to_date
Date: 2003-10-30 01:06:10
Message-ID: 75a2871f.0310291706.6bb0ec44@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi, I'm relatively new at programming w/ JDBC, so any help would be appreciated.

I am attempting to set a java preparedStatment parameter within Oracle's
to_date function. However, if I do so, a blank query is always
returned (no exception is thrown).

The prepared statment contains something like this

...
where x.mydate = to_date(?, 'DD-MON-YYYY')
...

later on, I use setObject to set the parameter's value:
prepStmt.setObject(paramNumber, someString)

someString always contains a date format that is readily converted
using to_date within SQL Plus. I have tried running the same query
within Oracle's SQLPlus, and have not had a problem. I have also tried using
prepStmt.setString()(although this is not general enough for my code)
and a blank query is still returned.

Thanks in advance to anyone who responds.

-Jeremy

Browse pgsql-jdbc by date

  From Date Subject
Next Message Nutan 2003-10-30 07:54:43 connection pool pg73jdbc3
Previous Message Aleksey 2003-10-29 19:37:24 JDBC DatabaseMetaData problem