PDA

View Full Version : Converting Date object into string and vice versa


Rizwan Ahmed Siddiqui
08-15-2005, 01:41
Hi Guys

i am facing some problem with conversion of Object to
string.
i am getting one date feild "DOJ" under scott from
ORCL db in Date object form, i want to convert that object
into string. how could i do this. Please help me.
and also how do i able to convert the date in string
format to object.

Please help me in this.
is there any services which i need to call or do i need
to write explict java code.

All inputs are appreciated.
Rizwan

mwr0707
08-15-2005, 09:29
Assuming you are using the JDBC adapter, and are creating a select adapter service...

If you set the output field type on the SELECT tab to java.lang.String, the adapter will do the string conversion for you.

If you want more control, e.g. using
SELECT TO_CHAR(hiredate,'MM/DD/YYYY') from emp;

You can use a custom sql adapter service.