How to connect jsp to mysql: first download the JDBC driver on the official website of mysql; then put the jar package into the lib folder of the tomcat installation directory; then create test data in mysql; finally create it in eclipse Project, and create a JSP file to run.
Recommendation: “Mysql Video Tutorial”
jsp Connection MYSQL Database Tutorial
Steps:
1. Download the JDBC driver from the official website of mysql. URL: https://dev.mysql.com/downloads/connector/j/
2. Put the jar package inside (mysql-connector-java-5.1.41-bin.jar) into tomcat Under the lib folder of the installation directory, for example, my directory is: C:\apache-tomcat-8.0.36-windows-x64\apache-tomcat-8.0.36\lib. Restart tomcat.
3. Create test data in mysql, first create a database named testdb; then create a table named testform, the table has three fields, namely: id, name, age; finally add a few lines Test Data.
4. Create a project in eclipse and create a JSP file named test.jsp. The test.jsp code is as follows: (Pay attention to modify the corresponding parameters)
5. Run the jsp file.
The above is the detailed content of the jsp link mysql step method, more please pay attention to other related articles on 1024programmer.com!