Hi,
If you delegate the configuration work to Spring, than you can configure
DataSource in a more easier way. As you work on OSGI platform, I
recommend that you register your DataSource with the OSGI Service !
ex of Spring-Ibatis config file
|<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="url">
<value>jdbc:mysql://localhost/test</value></property>
<property name="username"><value>root</value></property>
<property name="password"><value>rootPassword</value></property>
</bean>
<bean id="sqlMapClient"
class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation">
<value>./spring/ibatis/SqlMapConfig.xml</value>
</property>
</bean>
|
Regards,
Charles
On 24/03/11 06:31, Brimstedt wrote:
Hello,
I have used camel-ibatis in a route in smx 4.x if it helps.
I've just started to use it and so far made a select that outputs rows the
log.
The first problem I had was to get ibatis to find my jtds driver (ended up
putting it in lib and exposing it in custom.properties.
The second problem I have is with configuring the datasource, right now I
have it hardcoded in SqlMapConfig.xml and have yet to find a way to put it
in my beans.xml or configure db connection using java. If someone could
enlighten me here, id be very happy.
If I can provide any help on the camel-ibatis usage id be delighted.
br
/Linus
Gert Vanthienen wrote:
Mike,
There's a good chance that nobody has tried the
ServiceMix/Camel/iBatis comibination before. However, it sounds like
a reasonable use case, so would you be willing to raise a JIRA issue
and provide a patch with the stuff you have so far (perhaps remove the
bits that are proprietary to your company or project) so we can turn
it into a working example ?
--
View this message in context:
http://servicemix.396122.n5.nabble.com/Using-MyBatis-in-a-camel-route-on-SMX-tp4256837p4261774.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.