webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

webMethods String to java.sql.Date/Time issue.

webMethods Community Member

webMethods Community MemberWed September 20, 2017 03:54 PM

  • 1.  webMethods String to java.sql.Date/Time issue.

    Posted Mon January 15, 2007 02:04 AM

    Hello,

    I have been having a problem with insertion of a date/time string in the format dd-MM-yyyy HH:mm (java format) into an Oracle 10g database.
    Generating the insert adaptor service using webMethods developer, I have the Oracle date field mapped to jdbc date field. The input to the service is a string of the above format.

    Whilst the date is inserted, the time is not.

    What am I missing?

    Thanks.

    Cheers
    G


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 2.  RE: webMethods String to java.sql.Date/Time issue.

    Posted Mon January 15, 2007 02:39 PM

    I remember battling with similar issues. Some considerations:

    • Are you certain of your oracle table data type?
    • What data type do you tell the adapter to use? In the insert tab, the following works for us:JDBC type (top): TIMESTAMP, Input field type (bottom): java.util.date (changed from default java.sql.timestamp if I remember correctly)

    HTH

    Loic


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 3.  RE: webMethods String to java.sql.Date/Time issue.

    Posted Mon January 15, 2007 03:29 PM

    Did you select jdbc filed type java.lang.String…
    Also try this format dd-MMM-yyyy HH:mm:ss if not ask your ORA team in what format are they expecting and change it accordingly using via date Format service.

    HTH,
    RMG


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 4.  RE: webMethods String to java.sql.Date/Time issue.

    Posted Mon January 15, 2007 03:44 PM

    Hi Kasinath,
    I have faced to similar issues recently, If you are using mapping String to Date type(String to Date) we have service available in WMPublic folder. If you are mapping to a timestamp type try using this format: dd-MMM-yy hh.mm.ss.SSSSSS a. Oracle understands this format.

    If you need more information, i will help you.
    thanks & regards,
    vijay


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 5.  RE: webMethods String to java.sql.Date/Time issue.

    Posted Wed September 13, 2017 06:18 AM

    Hi

    I am recently facing this issue of inserting dat time to OracleDb.

    I tried the above mentioned ways but no luck.

    Can anyone help on this?


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 6.  RE: webMethods String to java.sql.Date/Time issue.

    Posted Wed September 13, 2017 08:14 AM

    Hi Preethika,

    please provide some more details as well as some version informations.

    • wM Version
    • JDBC Adapter Version
    • Oracle Version
    • Driver Jar Version.

    Are there any messages in the server.log or error log which might be helpful for analysis?

    Regards,
    Holger


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 7.  RE: webMethods String to java.sql.Date/Time issue.

    Posted Wed September 20, 2017 05:39 AM

    Hi,

    i have the same issue

    com.wm.pkg.art.error.DetailedServiceException: [ART.117.4002] Adapter Runtime (Adapter Service): Unable to invoke adapter service dao:callROCreateSimul.
    ClassCast Exception for field: V_MATURITY. Error: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Date

    Regards


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 8.  RE: webMethods String to java.sql.Date/Time issue.

    Posted Wed September 20, 2017 03:19 PM

    Hi Olivier,

    can you provide some Screenshots of your adapter service showing the columns and inputs/outputs definition?

    Usually you should the inputs/outputs to java.lang.String when the column is defined as TIMESTAMP.
    ART will do the conversion in background.

    Regards.
    Holger


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 9.  RE: webMethods String to java.sql.Date/Time issue.



  • 10.  RE: webMethods String to java.sql.Date/Time issue.

    Posted Thu September 21, 2017 09:30 AM

    Hi Olivier,

    please set the Input field type to either java.util.Date or java.lang.String instead of java.sql.Date.

    The Adapter and the Driver will handle the conversion in Background for you.

    Regards,
    Holger


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 11.  RE: webMethods String to java.sql.Date/Time issue.

    Posted Thu September 21, 2017 03:11 PM

    Hi Holger,

    thanks for the update.
    The fields to change the type is not available this is an adapter type Store Procedure with signature, i don’t know if it is normal.

    Regards


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 12.  RE: webMethods String to java.sql.Date/Time issue.

    Posted Fri September 22, 2017 01:06 PM

    Hi Olivier,

    can you try to convert the java.lang.String to a java.util.Date and then assign this date to the adapter?
    Hopefully the java.util.Date can be converted to the java.sql.Date.

    Regards,
    Holger


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB