I've got following java class.
package com.org.data.dbresource;
import org.springframework.orm.ibatis.SqlMapClientTemplate;
public class DBConnectionManager {
private SqlMapClientTemplate sqlMapClientTemplate;
public void setSqlMapClientTemplate (SqlMapClientTemplate sq)
{
this.sqlMapClientTemplate = sq;
}
public SqlMapClientTemplate getSqlMapClientTemplate ()
{
return this.sqlMapClientTemplate;
}
}
My Spring xml looks like following:
<bean id="IbatisDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="jdbc/RSRC/app/oltp"/>
</bean>
<bean id="MySqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" value="classpath:sql-map.xml"/>
<property name="dataSource" ref="IbatisDataSource"/>
</bean>
<bean id="myObject" class="com.org.data.dbresource.DBConnectionManager">
<property name="sqlMapClientTemplate" ref="MySqlMapClient"/>
</bean>
Error I get is:
Failed to convert property value of type [com.ibatis.sqlmap.engine.impl.SqlMapClientImpl] to required type [org.springframework.orm.ibatis.SqlMapClientTemplate] for property 'sqlMapClientTemplate';
Everything works fine if, instead of SqlMapClientTemplate
I pass SqlMapClient
but then I have to explicitly catch SQLExceptions
What should I change?