Web project design and development-DBHelper3 and dbhelper3

Source: Internet
Author: User

Web project design and development-DBHelper3 and dbhelper3

This course aims to add, delete, modify, and query data in the database based on DBHelper.

The specific content is:

I. Program writing

1. Create a project-Mangage
2. Create five packages in the src directory: DAO, DBHelper, Entity, Servlet, and tools.
3. Compile the testDAO test file, userDAO, DBHelper, user entity class, servlet class UserServlet, and code searching online using the java reflection mechanism.
4. Create the jsp file user. jsp, show. jsp, and updata. jsp to add, delete, modify, and query database data.
5. Add the Link Configuration File
2. Run the program
Run as directly on myeclipse tomcat
3. debug and modify the code
When the code is wrong or the webpage is not displayed correctly: First, do not immediately write the code at the other layer after writing the code at the m layer. First, test UserDAO, test the UserDAO program directly in testDAO. After the test is successful, thank you for the next code.

When a servlet error occurs, you should click run on server on run as at the beginning of creation to display another page, even if it is correct, or comment out the code and write the output statement directly.

You can modify the displayed error according to the webpage prompt.
Experience and experience: In this DBHelper test, because many operations are required, you can test the current Code step by step after writing a code, do not wait until all the code is written before testing. If an error occurs, you do not know where the error is. In the process of writing code, you can skip writing, but you must understand the principle. You can discuss it with others.

 

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.