Advertisement
Guest User

Untitled

a guest
Apr 24th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. <bean id="mysqlDataSource" class="org.apache.commons.dbcp.BasicDataSource">
  2. <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
  3. <property name="url" value="jdbc:mysql://localhost/fj21" />
  4. <property name="username" value="root"/>
  5. <property name="password" value="root"/>
  6. </bean>
  7.  
  8. @Controller
  9.  
  10. private final JdbcTarefaDAO dao;
  11.  
  12. @Autowired
  13. public TarefasController(JdbcTarefaDAO dao) {
  14. this.dao = dao;
  15. }
  16.  
  17. @RequestMapping("novaTarefa")
  18. public String form(){
  19. return "tarefa/formulario";
  20. }
  21.  
  22. @Repository
  23.  
  24. private Connection connection;
  25.  
  26. @Autowired
  27. public JdbcTarefaDAO(DataSource dataSource) {
  28. try {
  29. this.connection = dataSource.getConnection();
  30. }
  31. catch(SQLException e) {
  32. new RuntimeException(e);
  33. }
  34. }
  35.  
  36. GRAVE: Context initialization failed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement