Storing java.sql.Timestamp in an object (IS 4.6)

I have written a custom java service in Developer 4.6 that takes Timestamp in string format as input and output is a java object storing java.sql.Timestamp object after converion.

when i run the service i can see the timestamp object value in the log of IS using System.out.println().
but in the pipeline, output(Object) of the service is null.

Any tips from anyone???

Thanks in advance

This seems pretty straightforward, the only cause I can think of is the way the object is put into the pipeline in the Java service.

Can you please reply back ASAP.
thanks

Service input:
TimestampString(String)
pattern(String)

Service output:
TimestampObject(Object)

Sample input data:
TimestampString : 2002/12/12 12:12:12
pattern:yyyy/MM/dd HH:mm:ss

Source code:


// pipeline
IDataCursor cursorIn = pipeline.getCursor();

cursorIn.first( “TimestampString” );
String tsString = (String) cursorIn.getValue();

cursorIn.first( “pattern” );
String pattern = (String) cursorIn.getValue();
cursorIn.destroy();

DateFormat inDf =(DateFormat) new SimpleDateFormat( pattern );
java.sql.Timestamp ts = null;

try {
java.util.Date date = inDf.parse(tsString);
ts = new java.sql.Timestamp(date.getTime());

System.out.println(“TimestampObject:”+ts);

}catch (Exception xcp){
throw new ServiceException ( xcp );
}

cursorIn.insertAfter(“TimestampObject”,ts);
cursorIn.destroy();


If i replace the statement

cursorIn.insertAfter(“TimestampObject”,ts);
with
cursorIn.insertAfter(“TimestampObject”,ts.toString());

i am getting the output value

I got it.

The object is there in the pipeline but its displaying null.

when i use the service in another service the o/p of the service is getting assigned.

thanks.