Quantcast

Insert a Date in Oracle database with database-binding-component

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Insert a Date in Oracle database with database-binding-component

gabriel
This post has NOT been accepted by the mailing list yet.
I am trying to use a BPEL to insert a record into a table within my database. This record should include a series of strings plus a timestamp of the moment the record was inserted. When creating a database-bound WSDL in OpenESB with the wizard, I choose the Table option an my table gets mapped automatically. The date field gets mapped into a xsd:string schema type. I then create an assign task and then drag the Current Date element from the toolbar like this: http://i.imgur.com/EWjR9J7.png However when trying to insert this into the database I get the following error:
2015-06-04T09:41:13.318+0200 FINEST [sun-database-binding.org.glassfish.openesb.databasebc.JDBCDenormalizer] (pool-5-thread-7)ClassName=org.glassfish.openesb.databasebc.JDBCDenormalizer;MethodName=populatePreparedStatement; !DBBC_R00726.JDBCDN_ColumnType!  == 12
2015-06-04T09:41:14.661+0200 SEVERE [sun-database-binding.org.glassfish.openesb.databasebc.OutboundMessageProcessor] (pool-5-thread-7) Failed to write message:.
java.lang.Exception: Failed to denormalize message. 13746223648002-42732-136526964730880245 .
	at org.glassfish.openesb.databasebc.OutboundMessageProcessor.processInOut(OutboundMessageProcessor.java:727)
	at org.glassfish.openesb.databasebc.OutboundMessageProcessor.execute(OutboundMessageProcessor.java:273)
	at org.glassfish.openesb.databasebc.OutboundMessageProcessor.run(OutboundMessageProcessor.java:153)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:722)
Caused by: java.sql.SQLException: Error occured while executing SQL.insert into MAIL (ASUNTO,CUERPO,EMISOR,DESTINATARIO,FECHA_EMISION) values (?,?,?,?,?) Reason: ORA-01861: literal does not match format string
 SQLState: 22008 ErrorCode: 1861
	at org.glassfish.openesb.databasebc.OutboundMessageProcessor.executeOutboundSQL(OutboundMessageProcessor.java:1871)
	at org.glassfish.openesb.databasebc.OutboundMessageProcessor.processInOut(OutboundMessageProcessor.java:703)
	... 5 more
If I rmove the date field from the insert sentence, then everything works okay. I think this might be related to the timestamp generated by Current Date element being in this format "2015-06-04T09:41:13.07+02:00" which is not directly accepted by Oracle, but from what I've read the ESB should do this conversion automatically. What am I missing here? How can I insert a timestamp with an oracle database?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Insert a Date in Oracle database with database-binding-component

param.singh
This post has NOT been accepted by the mailing list yet.

Are you using any date fields? This error is coming from Oracle SQL insert. Please share the column name with type also..

 

/Param

 

From: gabriel [via OpenESB Community Forum] [mailto:[hidden email]]
Sent: Thursday, June 04, 2015 1:20 PM
To: param.singh
Subject: Insert a Date in Oracle database with database-binding-component

 

I am trying to use a BPEL to insert a record into a table within my database. This record should include a series of strings plus a timestamp of the moment the record was inserted. When creating a database-bound WSDL in OpenESB with the wizard, I choose the Table option an my table gets mapped automatically. The date field gets mapped into a xsd:string schema type. I then create an assign task and then drag the Current Date element from the toolbar like this: http://i.imgur.com/EWjR9J7.png However when trying to insert this into the database I get the following error:

2015-06-04T09:41:13.318+0200 FINEST [sun-database-binding.org.glassfish.openesb.databasebc.JDBCDenormalizer] (pool-5-thread-7)ClassName=org.glassfish.openesb.databasebc.JDBCDenormalizer;MethodName=populatePreparedStatement; !DBBC_R00726.JDBCDN_ColumnType!  == 12
2015-06-04T09:41:14.661+0200 SEVERE [sun-database-binding.org.glassfish.openesb.databasebc.OutboundMessageProcessor] (pool-5-thread-7) Failed to write message:.
java.lang.Exception: Failed to denormalize message. 13746223648002-42732-136526964730880245 .
        at org.glassfish.openesb.databasebc.OutboundMessageProcessor.processInOut(OutboundMessageProcessor.java:727)
        at org.glassfish.openesb.databasebc.OutboundMessageProcessor.execute(OutboundMessageProcessor.java:273)
        at org.glassfish.openesb.databasebc.OutboundMessageProcessor.run(OutboundMessageProcessor.java:153)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:722)
Caused by: java.sql.SQLException: Error occured while executing SQL.insert into MAIL (ASUNTO,CUERPO,EMISOR,DESTINATARIO,FECHA_EMISION) values (?,?,?,?,?) Reason: ORA-01861: literal does not match format string
 SQLState: 22008 ErrorCode: 1861
        at org.glassfish.openesb.databasebc.OutboundMessageProcessor.executeOutboundSQL(OutboundMessageProcessor.java:1871)
        at org.glassfish.openesb.databasebc.OutboundMessageProcessor.processInOut(OutboundMessageProcessor.java:703)
        ... 5 more

If I rmove the date field from the insert sentence, then everything works okay. I think this might be related to the timestamp generated by Current Date element being in this format "2015-06-04T09:41:13.07+02:00" which is not directly accepted by Oracle, but from what I've read the ESB should do this conversion automatically. What am I missing here? How can I insert a timestamp with an oracle database?


To start a new topic under OpenESB Community Forum, email [hidden email]
To unsubscribe from OpenESB Community Forum, click here.
NAML

Param
Logicoy Inc.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Insert a Date in Oracle database with database-binding-component

param.singh
This post has NOT been accepted by the mailing list yet.
In reply to this post by gabriel

Missed your last sentence .. 

 

You have to form a valid insert query with TO_DATE / TO_CHAR function. Then only It will work..

 

/Param

 

From: Param [mailto:[hidden email]]
Sent: Thursday, June 04, 2015 2:33 PM
To: 'gabriel [via OpenESB Community Forum]'
Subject: RE: Insert a Date in Oracle database with database-binding-component

 

Are you using any date fields? This error is coming from Oracle SQL insert. Please share the column name with type also..

 

/Param

 

From: gabriel [via OpenESB Community Forum] [[hidden email]]
Sent: Thursday, June 04, 2015 1:20 PM
To: param.singh
Subject: Insert a Date in Oracle database with database-binding-component

 

I am trying to use a BPEL to insert a record into a table within my database. This record should include a series of strings plus a timestamp of the moment the record was inserted. When creating a database-bound WSDL in OpenESB with the wizard, I choose the Table option an my table gets mapped automatically. The date field gets mapped into a xsd:string schema type. I then create an assign task and then drag the Current Date element from the toolbar like this: http://i.imgur.com/EWjR9J7.png However when trying to insert this into the database I get the following error:

2015-06-04T09:41:13.318+0200 FINEST [sun-database-binding.org.glassfish.openesb.databasebc.JDBCDenormalizer] (pool-5-thread-7)ClassName=org.glassfish.openesb.databasebc.JDBCDenormalizer;MethodName=populatePreparedStatement; !DBBC_R00726.JDBCDN_ColumnType!  == 12
2015-06-04T09:41:14.661+0200 SEVERE [sun-database-binding.org.glassfish.openesb.databasebc.OutboundMessageProcessor] (pool-5-thread-7) Failed to write message:.
java.lang.Exception: Failed to denormalize message. 13746223648002-42732-136526964730880245 .
        at org.glassfish.openesb.databasebc.OutboundMessageProcessor.processInOut(OutboundMessageProcessor.java:727)
        at org.glassfish.openesb.databasebc.OutboundMessageProcessor.execute(OutboundMessageProcessor.java:273)
        at org.glassfish.openesb.databasebc.OutboundMessageProcessor.run(OutboundMessageProcessor.java:153)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:722)
Caused by: java.sql.SQLException: Error occured while executing SQL.insert into MAIL (ASUNTO,CUERPO,EMISOR,DESTINATARIO,FECHA_EMISION) values (?,?,?,?,?) Reason: ORA-01861: literal does not match format string
 SQLState: 22008 ErrorCode: 1861
        at org.glassfish.openesb.databasebc.OutboundMessageProcessor.executeOutboundSQL(OutboundMessageProcessor.java:1871)
        at org.glassfish.openesb.databasebc.OutboundMessageProcessor.processInOut(OutboundMessageProcessor.java:703)
        ... 5 more

If I rmove the date field from the insert sentence, then everything works okay. I think this might be related to the timestamp generated by Current Date element being in this format "2015-06-04T09:41:13.07+02:00" which is not directly accepted by Oracle, but from what I've read the ESB should do this conversion automatically. What am I missing here? How can I insert a timestamp with an oracle database?


To start a new topic under OpenESB Community Forum, email [hidden email]
To unsubscribe from OpenESB Community Forum, click here.
NAML

Param
Logicoy Inc.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Insert a Date in Oracle database with database-binding-component

Abhidhar
This post has NOT been accepted by the mailing list yet.
I'm newbie in Open ESB and I have the same problem. I use the "current date" option in the mapper, which format is YYYY-MM-DD and I need to get it with  a 'DD-MM-YYYY' format for my  database. What's the best way to format a date in OpenESB?

Thanks in advance for your help!
Loading...