Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <bean id="mysqlDataSource" class="org.apache.commons.dbcp.BasicDataSource">
- <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
- <property name="url" value="jdbc:mysql://localhost/fj21" />
- <property name="username" value="root"/>
- <property name="password" value="root"/>
- </bean>
- @Controller
- private final JdbcTarefaDAO dao;
- @Autowired
- public TarefasController(JdbcTarefaDAO dao) {
- this.dao = dao;
- }
- @RequestMapping("novaTarefa")
- public String form(){
- return "tarefa/formulario";
- }
- @Repository
- private Connection connection;
- @Autowired
- public JdbcTarefaDAO(DataSource dataSource) {
- try {
- this.connection = dataSource.getConnection();
- }
- catch(SQLException e) {
- new RuntimeException(e);
- }
- }
- GRAVE: Context initialization failed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement