201621123042 Java programming 14th operations

Source: Internet
Author: User

1. Summary of this week's study

1.1 Summarize the relevant contents of the database in the way you like (mind map or other).

2. Transform your system with a database

2.1 Briefly describe how to use the database to transform your system. What table do you want to build? The design of your watch.
What are the key classes used in JDBC in the 2.2 system?
2.3 Key code for database related modules. Critical lines need to be annotated.
2.4 Select: Use Jdbcutil to retrofit the system.

Reference: Experimental Task book-topic 5

2.5 Select: Use database connection Pool technical transformation system.

Reference: Experimental Task book-topic 6
Data Connection Pool Reference

2.6 Select: Use Transaction Transformation system

Reference: Experimental Task book-topic 4
Reference:TransactionTest.java

3. Code volume Statistics 3.1 Statistics the amount of code completed this week

The weekly code statistics need to be fused into a single table.

Week Time Total code Amount New Code Volume total number of files number of new files
1 44 44 2 2
2 213 213 10 5
3 417 204 10 5
5 676 259 17 7
6 1071 405 24 7
7 1780 709 30 6
8 1900 120 35 5
9 2335 435 41 6
10 2767 432 48 7
11 3321 595 57 9
12 3601 280 63 6
13 4131 531 67 4
14 4537 50W 73 6
15 4957 440 44 4
Option: 4. Database Learning Guide 1. MySQL Database basic operations

Create a database and insert your name and school number as a record. (, need to have their own school number, name)
Execute common SQL statements on your own established database (do it yourself, not necessary)

    • Reference: Experimental Task Book-topic 1
2. Using JDBC to connect to the database and statement

2.1 Use statement to manipulate the database. Complete the Experimental task book-topic 2. One of public static void displayAll() the public static int insert(Student stu) key codes and the appearance of their own school number.
2.2 If you want to finish querying student data based on a given name, complete the function public Student findStuByName(String name) , and how do you write the SQL statement?

2.3 What do you think is the routine of using JDBC to manipulate databases?

    • Reference: Experimental Task book-topic 2
3. PreparedStatement and Parametric queries

3.1 Use PreparedStatement, write public Student findStuByName(String name) , implement to find according to name,. (Paste the key code and run, need to appear in the operation of the number, comparison of 2.2, indicating the difference between the two implementations)
3.2 If you want to implement Fuzzy Lookup, how to modify? such as writing public List<Student> findStusByName(String name) , can be based on the name of fuzzy matching, such as the name of the students included in zhang the search out.

    • Reference: Experimental Task book-topic 3
4. Batch update test

On the database course, you need to test the acceleration of the index for lookups. However, it is not possible to visually experience the acceleration of the index by operating on a hundreds of or thousands of data volume. Now you want to write a program that inserts 100,000 of data in bulk, and that the contents of some fields in that data can be randomly generated.
4.1 Your code (advent number), statistic run time (use JUINT4 test, need to appear time contrast).
4.2 Choose: How fast is the speed of the insertion calculated? ( 条/秒 calculated in MB/秒 two different ways). and test the disk read and write performance of the disks on your computer and compare them.

5. Jdbcutil and DAO

5.1 Complete the test task-the 4th point in topic 5, which is to write the StudentDao interface and its implementation class StudentDaoJDBCImpl .
5.2 What are the benefits of accessing a database using DAO mode? Use the 4.1 code description to compare the traditional pattern with the code that accesses the database using DAO mode.
5.3 Using Jdbcutil to retrofit topic 3.1.

    • Reference: Experimental Task book-topic 5
6. Transaction processing

6.1 Using code and running results to prove that you did implement the transactional functionality, and what do you need to be aware of when you encode transactions? Note: to compare the changes made to the database in both the successful and failed run scenarios. (Paste a code that you think is more valuable, the number of the study)
6.2 When do you think you need to use transaction processing?

    • Reference: Experimental Task book-topic 4
    • Reference:TransactionTest.java
Optional: 5. Extracurricular reading

5.1

JDBC (TM) Database Access
5.2

What does Dao,service,controller,util,model mean in code structure, and why is it divided
5.3

MYSQ database management Tools Navicat Basic use Method

201621123042 Java programming 14th operations

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.