How to copy Excel file to database using Datamapper in Mule 3.4 ESB

Good morning everybody,

I have a big problem with the Datamapper component in the Mule ESB. I am trying to map an Excel file (xlsx) in an oracle database table. To do this, I created a JDBC connector with Oracle DataSource and all its materials, but when I go to the DataMapper Wizard to create a mapping, I cannot select the created Connector because there is no element in the list of connectors (in the datamapper output wizard shortcut). [Here is a screenshot of my problem below]

Screenshot of the DataMapper Wizard

I really don't understand why, could you help me?

In addition, I have a question for you: I need to insert other fields in the database in addition to the xls file, for example MuleMessageID, xls file name and Oracle SYSDATE. Is it possible?

, ,

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting" xmlns:smtp="http://www.mulesoft.org/schema/mule/smtp" xmlns:ftp="http://www.mulesoft.org/schema/mule/ee/ftp" xmlns:jdbc-ee="http://www.mulesoft.org/schema/mule/ee/jdbc" xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-mapper" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:quartz="http://www.mulesoft.org/schema/mule/quartz" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:https="http://www.mulesoft.org/schema/mule/https" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/ee/jdbc http://www.mulesoft.org/schema/mule/ee/jdbc/current/mule-jdbc-ee.xsd
http://www.mulesoft.org/schema/mule/https http://www.mulesoft.org/schema/mule/https/current/mule-https.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/quartz http://www.mulesoft.org/schema/mule/quartz/current/mule-quartz.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd
http://www.mulesoft.org/schema/mule/ee/ftp http://www.mulesoft.org/schema/mule/ee/ftp/current/mule-ftp-ee.xsd
http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/current/mule-scripting.xsd
http://www.mulesoft.org/schema/mule/smtp http://www.mulesoft.org/schema/mule/smtp/current/mule-smtp.xsd">
    <spring:beans>
        <spring:bean id="SettingProperty" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" scope="singleton">
            <spring:property name="locations">
                <spring:list>
                    <spring:value>classpath:pilot.properties</spring:value>
                </spring:list>
            </spring:property>
        </spring:bean>
    </spring:beans>

    <http:connector name="HTTPConnector" 
                    cookieSpec="netscape" 
                    doc:name="HTTP\HTTPS">
        <service-overrides messageFactory="it.aizoon.http.customHttpMultipart.MyHttpMultipartMuleMessageFactory"/>          
    </http:connector>

    <file:endpoint path="${file.output}" name="XSLXFile" responseTimeout="10000" doc:name="File"/>

    <jdbc-ee:oracle-data-source name="Oracle_Data_Source" user="${db.user}" password="${db.password}" url="${db.url}" doc:name="Oracle Data Source" transactionIsolation="UNSPECIFIED"/>
    <jdbc-ee:connector name="JdbcConnector" dataSource-ref="Oracle_Data_Source" validateConnections="true" queryTimeout="-1" doc:name="Database" pollingFrequency="0">
        <jdbc-ee:query key="storedProc" value="CALL ${db.storedProc}" />
    </jdbc-ee:connector>
    <data-mapper:config name="xls_to_db_grf" transformationGraphPath="xls_to_db.grf" doc:name="xls_to_db_grf"/>

    <!-- Starting Flow Declaration -->
    <flow name="zonal_imbalance_1.0Flow1" doc:name="zonal_imbalance_1.0Flow1">
        <http:inbound-endpoint 
            address="http://${conn.host}:${conn.port}/${conn.path}"
            connector-ref="HTTPConnector" doc:name="HTTP" exchange-pattern="request-response"/>
        <wildcard-filter pattern="*/${conn.path}*" caseSensitive="true" doc:name="Wildcard"/>
        <file:outbound-endpoint responseTimeout="10000" doc:name="Store XSLX File" path="C:\Users\paride.letizia\MuleStudio\workspace_ee\zonal_imbalance_1.0\src\test\resources\outputFolder"/>
        <data-mapper:transform doc:name="DataMapper"/>
        <jdbc-ee:outbound-endpoint exchange-pattern="request-response" queryTimeout="-1"  doc:name="ORACLE Database" queryKey="example" connector-ref="JdbcConnector">
            <jdbc-ee:query key="example" value="SELECT * FROM prova;"/>
        </jdbc-ee:outbound-endpoint>
</flow>
</mule>

, . .

+4
1

, JDBC "", . API, Oracle DB .

. Anypoint, " ":

, . , (, JDBC, FTP, HTTP, POP3 ..), API, Salesforce Twitter.

, , . , Oracle MS SQL, , ; Oracle MS SQL. , CSV . , .csv, csv-.

:

+1

All Articles