Balwant Kumar Singh
Balwant Kumar Singh

Reputation: 1178

Mule-DB configuration using spring-bean

I need a way to configure MySQL DB in Mule using Spring-Bean. I tried exploring on internet but there is no solution for me. I'm a newbie in mule. Any help would be appreciated.

Thanks

Upvotes: 0

Views: 1447

Answers (1)

Ryan Carter
Ryan Carter

Reputation: 11606

if you want to use a Spring bean, define a DataSource and supply it with Mysql Dirver and details something like:

<spring:bean id="dataSource"
            class="org.enhydra.jdbc.standard.StandardDataSource" destroy-method="shutdown">
            <spring:property name="driverName" value="com.mysql.jdbc.Driver" />
            <spring:property name="url" value="${db.url}" />
            <spring:property name="user" value="${db.user}" />
            <spring:property name="password" value="${db.password}" />
        </spring:bean>

And reference it form your db:config:

<db:generic-config name="dbConfig" dataSource-ref="dataSource" />

Upvotes: 1

Related Questions