Reputation: 1569
it is bug of WSO2DSS or its doesn't has future of it i am sending epoch value from WSO2 ESB to WSO2 DSS and firing this customized query
INSERT INTO public.emp2(e_device,e_amount,e_no,jointime) VALUES(?,?,?,(SELECT TIMESTAMP WITH TIME ZONE 'epoch' + 15555565225/1000 * INTERVAL '1 second'))
but its showing error My DSS config is like this
<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
the error of WSO2 DSS side is this
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
Upvotes: 1
Views: 1524
Reputation: 1268
Since you have put the jointime as timestamp you need to give the input as the following manner when giving the value for the jointime.
1990-01-01T00:00:00
Then you can avoid this error
Upvotes: 1