201621123078 Java programming 14th Week of study summary

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. Using database technology your system 2.1 briefly describes how to use the database to transform your system. What table do you want to build? The design of your watch.

At present, only two tables have been built: Book bibliography table, and student information table;

What are the key classes used in JDBC in the 2.2 system?

Answer: Uses the DriverManager class in JDBC, Connection, Statement, and ResultSet.

2.3 Key code for database related modules. Critical lines need to be annotated.

3. Code Volume statistics

3.1 Count 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 0 0 0 0
2 280 280 5 5
3 530 250 9 4
4 950 420 15 6
5 1345 395 20 5
6 1924 579 26 6
7 2248 324 31 5
8 2677 429 36 5
9 3020 343 42 6
10 3349 329 48 6
11 3725 376 54 6
12 4019 294 58 4
13 4282 263 62 4
14 4401 219 66 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)

2. Use the statement operation database with the JDBC Connection database and Statement2.1. Complete the experimental Task book-topic 2. One of the public static void Displayall () and public static int insert (Student stu) is the key code that appears with its own school number.


2.2 If you want to finish querying student data based on the specified name, complete the function public Student findstubyname (String name), where is the SQL statement written?
String sql = "select * from students WHERE name = "+name;
2.3 What do you think is the routine of using JDBC to manipulate databases?

Answer:

    • Load the database driver;
    • Establish a connection to the database;
    • Create a Database Action object
    • The SQL statement that defines the operation;
    • Perform the operation of the database;
    • Get and manipulate the result set;
    • Close () closes the object;
3. PreparedStatement and parameterized Query 3.1 use PreparedStatement, write public Student findstubyname (String name) to find by 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)



Answer: The difference is that compared to the lower preparedstatement efficiency, PreparedStatement can pre-compile, save time and improve efficiency.

201621123078 Java programming 14th Week of study summary

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.