开发者

How can I connect a mySQL database file by using JSP in Spring MVC?(Also Hibernate used.) [closed]

开发者 https://www.devze.com 2023-02-21 23:54 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying开发者_JS百科 this question so that it can be reopened, visit the help center. Closed 11 years ago.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消