JSP basic syntax six JSP+JDBC Access database

Source: Internet
Author: User
Tags mysql reset access database java se

After learning the JSP basic syntax and the use of HTML and JavaScript, JSP+JDBC connect the database to develop a dynamic Web page can be implemented.

For students who have studied Java SE, the operation of the database is not unfamiliar, if there are forgotten or will not be able to http://zhaoyuqiang.blog.51cto.com/6328846/1127658 learning.

What about the database connections in the JSP? How can we use the knowledge of HTML and JavaScript we've learned? This is the learning content of our article----JSP+JDBC access to the database.

We use an example to illustrate the JSP+JDBC Access database---user login instance. Just like the login mailbox, the user enters the account number and the password, if the correct word jumps to the homepage, if the error prompts or jumps to the error page. As shown in the following illustration:

First set up the database, the database test in MySQL, set up the table users. As shown in the following figure

After the database was built, the project was built in MyEclipse, and the MySQL driver package was directed into Lib.

Create the first JSP page----landing page login.jsp

<%@ page language= "java" contenttype= "text/html" pageencoding= "Utf-8"%>  

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.