IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
Expand all | Collapse all

Jdbc Adapter Data types Mapping

  • 1.  Jdbc Adapter Data types Mapping

    Posted 08/25/04 09:00 PM

    Hi All
    I am working on jdbc adapter (wm6.1),the problem here is jdbc data types,my oracle Database is having date coloum with DATE as date type
    and i can insert the date in following way yyyy-MM-dd hh:mm:ss (Date data type)
    but i have in my requirement is dd/mm/yyyy hh:mm:ss AM/PM
    when i am not able to change JDBC data type for that (i.e TIMESTAMP data type).
    second question is how can i append AM/PM using JDBC adapter .
    any suggestions will be highly appreciated
    thanks
    bye


    #Integration-Server-and-ESB
    #webMethods
    #Adapters-and-E-Standards


  • 2.  RE: Jdbc Adapter Data types Mapping

    Posted 08/25/04 11:43 PM

    Kitt,

    Use this dateformat which will solve your problem along with (AM/PM)
    dd/MM/yyyy HH:mm:ss a (‘a’ will give you whether it is AM/PM automatically)

    And for changing the dateformat use builtin service (pub.date:dateTimeFormat)service (set inputs currentPattern,newPaterrn.
    So map this new dateformat to your AdapterService/Field.

    HTH,
    RMG


    #Integration-Server-and-ESB
    #webMethods
    #Adapters-and-E-Standards


  • 3.  RE: Jdbc Adapter Data types Mapping

    Posted 08/26/04 02:45 PM

    Thanks RMG,

    I already used those services to get the correct format for
    date and time in webMethods but when we map input values through JDBC adapter of the format dd/MM/yyyy HH:mm:ss a its giving me the error
    and when i am giving it in format yyyy-MM-dd hh:mm:ss its correctly inserting those values .is there any other way to insert date in that format or we need to write java code for that.

    Regards,


    #webMethods
    #Integration-Server-and-ESB
    #Adapters-and-E-Standards


  • 4.  RE: Jdbc Adapter Data types Mapping

    Posted 08/26/04 02:56 PM

    Kitt,

    This change should resolve your problem,

    In your insert JDBC Adapter Service set the “InputFieldType” option for Date that you are mapping,there is an option to use (java.lang.String).So this Date string will take any format and internally your DB receives the Dateformat as expected.

    And map your new dateformat to the AdapterService/DateField(String)

    HTH,
    RMG.


    #Adapters-and-E-Standards
    #Integration-Server-and-ESB
    #webMethods


  • 5.  RE: Jdbc Adapter Data types Mapping

    Posted 08/26/04 04:11 PM

    Thanks RMG for the quick response,

    I guess I already did that before,i already changed the Data type
    with Column variable DATED with input Field Type is JAVA.lan.string.

    I just got one more Question If You can help me out with this
    i inserted those dates in format yyyy-mm-dd hh:mm:ss.fffffffff
    i am able to extract that values with respect to yyyy-mm-dd
    SQL Select * from Table_name Where t1.DATED= DATE’2004-08-25’
    is working fine.
    But if i need to extract these value depend upon the time values hh:mm:ss same logic is not working .
    Select * from Table_name Where t1.DATED= DATE’2004-08-25 12:12:12.fffffffff’

    I will appreciate.
    Thanks.


    #Adapters-and-E-Standards
    #webMethods
    #Integration-Server-and-ESB


  • 6.  RE: Jdbc Adapter Data types Mapping

    Posted 08/26/04 04:53 PM

    Kitt,

    If you want query depends on date,time values then your sql statement syntax should be this way.
    Select * from Table_name Where DATED= to_date(‘2004-08-25 12:12:12’,‘yyyy-mm-dd hh:mi:ss’)

    So you can test this statement using JDBC Adapter Custom/DynamicSQL option or use some other SQL client.It will work.

    HTH,
    RMG


    #webMethods
    #Integration-Server-and-ESB
    #Adapters-and-E-Standards


  • 7.  RE: Jdbc Adapter Data types Mapping

    Posted 08/26/04 05:38 PM

    Thanks RMG for that to_date function, its working fine.
    I need to figure out the first problem now .

    I will appreciate your help.


    #Integration-Server-and-ESB
    #Adapters-and-E-Standards
    #webMethods


  • 8.  RE: Jdbc Adapter Data types Mapping

    Posted 08/26/04 05:41 PM

    Thanks RMG for that to_date function, its working fine.
    I am still researching on that DATE problem.

    Thanks.


    #webMethods
    #Adapters-and-E-Standards
    #Integration-Server-and-ESB


  • 9.  RE: Jdbc Adapter Data types Mapping

    Posted 08/26/04 05:41 PM

    Glad it worked,
    And I think your first problem means new dateformat,AM/PM problem sounds solved right based on my posts and your responses.

    goodluck,


    #Integration-Server-and-ESB
    #webMethods
    #Adapters-and-E-Standards


  • 10.  RE: Jdbc Adapter Data types Mapping

    Posted 08/26/04 10:21 PM

    hi,
    The first problem is not yet solved, I checked my flow service
    after changing for the Column variable DATED with input Field Type is JAVA.lan.string. i still facing the same problem

    the error is ::-

    com.Wm.app.b2b.server.ServiceException[ART.117.4002]
    Adapter Runtime(Adapter Service):
    [ADA.1.314] Cannot set data for the input field DATED
    Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff

    i hope u got my point
    thanks.


    #Adapters-and-E-Standards
    #Integration-Server-and-ESB
    #webMethods


  • 11.  RE: Jdbc Adapter Data types Mapping

    Posted 08/26/04 10:35 PM

    Kitt,

    This error indicates that you are not mapping the correct date format.so please check in the mapping before invoking the Adapter Service and see whether the dateformat is messingup in the pipeline .

    HTH,
    RMG


    #Integration-Server-and-ESB
    #webMethods
    #Adapters-and-E-Standards


  • 12.  RE: Jdbc Adapter Data types Mapping

    Posted 08/26/04 10:40 PM

    If not test inserting the data manually providing with right format by running the AdapterService and see if it throws the same error.
    So if everything is fine then some thing in messed up in the mapping itself before invoking Insert Adapter Service.

    Give it a shot.


    #webMethods
    #Integration-Server-and-ESB
    #Adapters-and-E-Standards


  • 13.  RE: Jdbc Adapter Data types Mapping

    Posted 08/26/04 11:04 PM

    thanks for replying ,
    I am running the Adapter service just by giving the
    manual data I gave Date format yyyy-mm-dd hh:mm:ss this service is working but not for the other format, Input has to be in this above format.
    if i give this as an input to JDBC adapter service for DATED variable
    "yyyy-mm-dd hh:mm:ss a "for (Am/Pm) its not recognizing “a” (giving error).I assume that there there is some other way to do that I think some thing has to do with ‘fffffffff’ got any idea?

    "yyyy-mm-dd hh:mm:ss.ffffffff "
    bye.


    #webMethods
    #Integration-Server-and-ESB
    #Adapters-and-E-Standards


  • 14.  RE: Jdbc Adapter Data types Mapping

    Posted 08/26/04 11:49 PM

    Kitt,

    If you are inserting with dateformat yyyy-mm-dd hh:mm:ss then there is no need of specifying AM/PM,since the Oracle itself will take care of adding AM/PM stamp for DataType ‘Date’ when you insert the values.

    I tested here the same and checked in the DB for Datefield.

    So why you need to explicitly map the AM/PM stamp?

    Regards,


    #webMethods
    #Adapters-and-E-Standards
    #Integration-Server-and-ESB


  • 15.  RE: Jdbc Adapter Data types Mapping

    Posted 08/27/04 01:51 PM

    HI,
    yeah that true ,Oracle will take care of AM/Pm but when i give
    time for example 4:50:50 its by default taking it as 4.50.50 AM
    instead of PM so I think Oracle has to be set up correctly or its some other issue.
    Did you got the correct AM/PM stamp ,and did you try to give different format other then date format yyyy-mm-dd hh:mm:ss .

    Thanks.


    #Integration-Server-and-ESB
    #webMethods
    #Adapters-and-E-Standards


  • 16.  RE: Jdbc Adapter Data types Mapping

    Posted 08/27/04 02:31 PM

    Kitt,

    yes i did tried giving the date format with
    yyyy-mm-dd hh:mm:ss with AM/PM stamp from the adapter service,i seen the same error which you are getting.And after sometime i got that Oracle itself is putting AM/PM stamp in the Date FieldType after inserting.

    May be you have to take this to your oracle folks and investigate on this problem 4.50.50 AM showing instead of PM.

    HTH,
    RMG


    #Adapters-and-E-Standards
    #Integration-Server-and-ESB
    #webMethods


  • 17.  RE: Jdbc Adapter Data types Mapping

    Posted 08/27/04 02:55 PM

    Thanks for your time!!
    i will investigate over it.


    #Adapters-and-E-Standards
    #webMethods
    #Integration-Server-and-ESB


  • 18.  RE: Jdbc Adapter Data types Mapping

    Posted 07/28/05 08:52 AM

    Hi ,
    I want to format date from YYYYMMDD to YYYY-MM-DDThh:mm:ss.sTZD.
    I using dateTimeFormat service by providing current pattern and new pattern but I am getting error. Could anyone can help.
    Thanks in advance.
    sreenivas


    #Adapters-and-E-Standards
    #webMethods
    #Integration-Server-and-ESB


  • 19.  RE: Jdbc Adapter Data types Mapping

    Posted 11/09/05 08:55 PM

    Hi All
    I am working on jdbc adapter (wm4.6), the problem here is jdbc data types, my oracle Database is having date column with DATE as date type and I can not insert the date and time in any format. I tried yyyy-MM-dd hh:mm:ss (Date data type) and many different patterns but I can not insert date and time in the same Oracle filed. The error I got is:

    java.sql.SQLException: ORA-01830: date format picture ends before converting entire input string

    Can anyone please help me out?

    Thanks in advance


    #webMethods
    #Integration-Server-and-ESB
    #Adapters-and-E-Standards