Summary of knowledge points
- Installation and use of MYSQL database
- JDBC statement to connect to the database, close the connection
- Sequence query, condition and sort query
- Addition and deletion operations
- Use prepared statements
General query and transaction management
Supplementary test in class
1. Countries with a population greater than 6,016,531
2. The total population of countries in the Middle East
3. Countries with the longest and shortest life expectancy
code analysis
11_1: Sequence query
11_2: Randomly query two records in the mess table in the student database, move the cursor to the last row, and then obtain the row number of the last row to obtain the number of records in the table.
11_3: Query the students with the surname Zhang in the message table, the height is greater than 16.5, the birth year is 2000 or before 2000, and the month is after July, and sort by date of birth.
11_4: Change, add and delete operations.
11_5: Use prepared statements to add records to the mess table and query records with the surname Zhang.
11_6: Pass the database name and SQL statement to the Query class object.
11_7: JDBc transaction processing
11_8: Create a database named students with Derby database management system, and create a chengji table in the database