IBM RAD data source problem

5 views
Skip to first unread message

Lei

unread,
Apr 12, 2013, 2:25:11 PM4/12/13
to programmin...@googlegroups.com
In RAD, the following declaration will produce error:

@Resource(name="dataSource")
public void setDataSource(DataSource dataSource) {
    this.jdbcTemplate = new SimpleJdbcTemplate(dataSource);
}
while in eclipse the above code will be working very well.

Lei

unread,
Apr 12, 2013, 2:26:08 PM4/12/13
to programmin...@googlegroups.com
change the code to following will overcome the problem:

        private DataSource dataSource;
private SimpleJdbcTemplate jdbcTemplate;

 
@Resource(name="dataSource")
public void setDataSource(DataSource dataSource) {
this.dataSource = dataSource;
    this.jdbcTemplate = new SimpleJdbcTemplate(dataSource);
}
Reply all
Reply to author
Forward
0 new messages