My Oracle Support Banner

JCAPS 5.1.1 - How can I convert Date to Java.sql.Timestamp using java in the JCD code? (Doc ID 1025271.1)

Last updated on JULY 16, 2015

Applies to:

Oracle Java CAPS - Version 5.1.0 and later
Information in this document applies to any platform.


How can I convert Date to Java.sql.Timestamp? The code below compiles, but are they any jcaps typeConverter methods that can be used?

The print for Alert_1.getTimeStamp() returns the following in the logs:

[#|2006-11-01T13:24:13.831-0500|INFO|IS5.1.1|STC.eGate.CMap.Collabs.prjAlertMessage.svcJcdAlertMsg.prjAlertMessage.jcdAlertMsg|_ThreadID=25;ThreadName=JMS Async S3;Context=prjAlertMessagedpAlertMsg/jmsAlertTopic_svcJcdAlertMsg_ejb;|+++++++++ Time Stamp: Wed Nov 01 13:24:09 EST 2006|#]

It seems in the format :"EEE MMM dd HH:mm:ss zzz yyyy", it uses the following code:

java.util.Date alertTimeStamp;
java.text.SimpleDateFormat alertdateformat = new
java.text.SimpleDateFormat( "EEE MMM dd HH:mm:ss zzz yyyy" );
try {
    java.util.Date parsed = alertdateformat.parse(Alert_1.getTimeStamp() ); " after parse alert TimeStamp" + parsed.toString() );
    // Java.sql.Timestamp errorTimestamp = parsed;
    oraErrorMsg_1.getERROR_MSG().setDATESTAMP(errorTimeStamp );
} catch ( java.text.ParseException pe ) { "+++++Date Parse Exception" + Alert_1.getTimeStamp() );


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.