I'm trying to understand how to work with Spring JDBC framework.
I've found example on http://www.tutorialspoint.com/spring/spring_jdbc_example.htm and trying to implement in my own project.
This is my example
package test;
import javax.sql.DataSource;
import org.springframework.jdbc.core.JdbcTemplate;
public class TestJDBCTemplate {
private DataSource dataSource;
private JdbcTemplate jdbcTemplateObject;
public void setDataSource(DataSource dataSource) {
this.dataSource = dataSource;
this.jdbcTemplateObject = new JdbcTemplate(dataSource);
}
}
But I got the problem with
import javax.sql.DataSource
Access restriction: The type 'DataSource' is not API (restriction on required library 'C:\Program Files (x86)\Java\jre1.8.0_31\lib\rt.jar')
What's wrong with this import and how to fix it. This kind of import I've seen in all examples about Spring JDBC framework.