【问题标题】:WSO2 DSS not working properly while i am sending this query in to postgres database its showing errors当我将此查询发送到 postgres 数据库时,WSO2 DSS 无法正常工作,它显示错误
【发布时间】:2014-01-01 10:16:19
【问题描述】:

这是 WSO2DSS 的错误,或者它没有未来 我正在将纪元值从 WSO2 ESB 发送到 WSO2 DSS 并触发此自定义查询

INSERT INTO public.emp2(e_device,e_amount,e_no,jointime) VALUES(?,?,?,(SELECT TIMESTAMP WITH TIME ZONE 'epoch' + 15555565225/1000 * INTERVAL '1 second'))

但它显示错误我的 DSS 配置是这样的

<query id="insert_emp2_query" useConfig="default">
      <sql>INSERT INTO public.emp2(e_device,e_amount,e_no,jointime) VALUES(?,?,?,(SELECT TIMESTAMP  'epoch' + ?/1000 * INTERVAL '1 second'))</sql>
      <param name="e_device" ordinal="1" sqlType="STRING"/>
      <param name="e_amount" ordinal="2" sqlType="STRING"/>
      <param name="e_no" ordinal="3" sqlType="INTEGER"/>
      <param name="jointime" ordinal="4" sqlType="TIMESTAMP"/>
   </query

WSO2 DSS端的错误是这样的

Nested Exception:-
java.lang.NumberFormatException: date string can not be less than 19 characters

<soapenv:Reason>
      <soapenv:Text xml:lang="en-US" xmlns:xml="http://www.w3.org/XML/1998/namespace">DS Fault Message: Error in DS non result invoke.
DS Code: DATABASE_ERROR
Nested Exception:-
javax.xml.stream.XMLStreamException: DS Fault Message: Error in 'SQLQuery.processNormalQuery'
DS Code: DATABASE_ERROR
Source Data Service:-
Name: emp2_DataService
Location: /emp2_DataService.dbs
Description: N/A
Default Namespace: http://ws.wso2.org/dataservice
Current Request Name: insert_emp2_operation
Current Params: {jointime=1361855692325, e_amount=5, e_no=5, e_device=5}
Nested Exception:-
java.lang.NumberFormatException: date string can not be less than 19 characters

</soapenv:Text>
   </soapenv:Reaso

【问题讨论】:

  • 相同的查询在 Db 中运行良好

标签: java types wso2 wso2esb wso2dss


【解决方案1】:

由于您已将加入时间作为时间戳,因此在为加入时间提供值时,您需要按以下方式提供输入。

1990-01-01T00:00:00

那么你就可以避免这个错误

【讨论】:

    猜你喜欢
    • 2016-03-06
    • 1970-01-01
    • 2017-06-30
    • 1970-01-01
    • 1970-01-01
    • 2019-02-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多