[mule-user] How to read/write CLOB, BLOB or XMLTYPE with JDBC Connector ?

837 views
Skip to first unread message

Bertrand Gillis

unread,
Mar 19, 2012, 10:14:47 AM3/19/12
to us...@mule.codehaus.org
Dear Mule experts,

I'm just trying to figure out how to read or write an Oracle type like CLOB, BLOB or even XMLTYPE using a JDBC connector.

Imagine I have a table like the following one:

CREATE TABLE
MESSAGE
(
ID NUMBER NOT NULL,
XML_DATA CLOB,
CONSTRAINT MESSAGE_PK PRIMARY KEY (ID),
);

CREATE SEQUENCE MESSAGE_SEQ
START WITH 1
INCREMENT BY 1
NOMAXVALUE;

and a basic Mule config

What should be the payload of my message ?
Certainly a Map payload with the following key {ID, XML_DATA}.
But what should be the type of the value corresponding to these keys ?

Currently, I have the xml stream available as a java.lang.String or a org.w3c.dom.Document.

Is it possible to use a JDBC connector for that purpose or should I use PL/SQL stored procedure or a even a Mule component to solve this use case ?

Thanks in advance for your help,

Bertrand --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Bertrand Gillis

unread,
Mar 19, 2012, 10:16:47 AM3/19/12
to us...@mule.codehaus.org
Hereby a basic Mule config:
<jdbc:connector name="jdbcConnector" dataSource-ref="jdbcDataSource">
<jdbc:query key="outboundInsertStatement"
value="INSERT INTO MESSAGE (ID, XML_DATA) VALUES (#[map-payload:ID],
#[map-payload:XML_DATA])"/>
</jdbc:connector>
Reply all
Reply to author
Forward
0 new messages