spring3-annotation-JdbcDaoSupport

Użyj adnotacji w dao

<code>@Repository("testDao")
public class TestDaoImpl extends JdbcDaoSupport implements BaseDao{

@Override
public Object addObject(String sqlid, Object obj) {
    // TODO Auto-generated method stub
    return null;
}
</code>

Przyczyna: java.lang.IllegalArgumentException: wymagane jest „dataSource” lub „jdbcTemplate”

Nie chcę używać :

<code><bean id="termsDao" class="com.manage.base.dao.impl.TestDaoImpl">
    <property name="jdbcTemplate" ref="jdbcTemplate"/>
</bean>
</code>

ten kod ustawiony w xml, a „jdbcTemplate” został zdefiniowany w innych „spring-xml”。

Jak rozwiązać ten problem za pomocą adnotacji : „„ dataSource ”lub„ jdbcTemplate ”jest wymagane”

questionAnswers(2)

yourAnswerToTheQuestion