Do you advice any tutorial or example?
Don't put it in a JSP; that logic belongs in a service. The service is called by a controller, which is mapped to a particular request from a JSP.
Lots of examples from Spring docs:
- Spring JDBC
- Spring MVC step by step
To connect to a MySQL database with Java you clearly need to understand JDBC fundamentals first: specially, how to connect to a Database.
Then you can start worrying about connecting to your MySQL DataBase within SpringMVC or a JSP file. To do that, you will need to provide information about what Application Server you are using.
精彩评论