I need to write a java service where java.lang.string needs to be converted to java.sql.timestamp.
Need to do two things:
1.Change the “Input Field Type” of DATE column from java.lang.String to java.sql.timestamp in the adapter service
2.Converting date string to a java.sql.timestamp object prior to invoking the adapter service""
if the build in service “pub.date:formatDate” is not available in WmPublic package,
you might want to have look at the WmTransformationServices package or the PSUtilities packagae (both available from the download section of the community).
At least one of them contains a service your are looking for.
Remember to change the input field of your Adapter Service to java.util.Date instead of java.lang.String or java.sql.Timestamp. It will be automatically mapped to Database datatype TIMESTAMP by the Adapter.
if the WmPublic service is available it is always preferrable to use this one.
But this does not change the output type:
It is java.util.Date, not java.sql.Timestamp.
Indeed this seems to be an older post from 2012.
I got irritated by latest update Waleed.
Even by updating older posts with current possibilities this might help the community members to learn about improvements which have been made to code base over time.
So I could use some help. I am new to webMethods and have been trying to fix an issue for sometime.
Maybe if you guys had some i/p that would help
This is the DB table
Name Null Type
EVENT_ID NOT NULL NUMBER(20)
SOURCE VARCHAR2(20)
TARGET VARCHAR2(25)
EVENT_DATE DATE
I am now trying to use the JDBC adapter to insert a row, I have problems with the date column when specifying the input object as a string. See attached image.
I read through some of the posts and tried to use the to_date function, passing in the string a i/p.
However I still get the following.
com.wm.pkg.art.error.DetailedServiceException: [ART.117.4002] Adapter Runtime (Adapter Service): Unable to invoke adapter service ServerLogTest.database:insertIntoEvents.
IllegalArgument Exception for field: EventE. Error: java.lang.IllegalArgumentException
I wonder if these is a service for string to java.sql.date conversion