201711671224 "Java Programming" Chapter 11 learning summary

Learning content summary

  • Connect to the database:Connection getConnection(java.lang.String,java.lang.String,java.lang.String)
    Connection getConnection(java.lang.String)
  • Conditions and sorting query: when statements and order by sub-statement
  • Update, add and delete:
    • Update:update 表 set 字段 = 新值 where <条件子句>
    • Add to:insert into 表(字段列表) values (对应的具体记录)
    • delete:delete from 表名 where <条件子句>
  • Wildcard? Use: it can be used in prepared statements in ? the wildcard (English?) Instead of the value of the field
  • Services: refers to the application to ensure that transactions executed SQL statements either all-or-not execute
    • JDBC transaction steps: first with setAutoCommit(booean b) a method close automatically submitted method; then the commit() method for processing a transaction; a rollback() failed transaction processing method

Code debugging and problem solving in the process

  • Question: P337 debugging Example11_4.java Chapter XI of the time, no result set output record
  • Solution: When you return to the result set, you must immediately record the output of the result set, or will then automatically performs the update statement

Other (perception, thinking, etc.)

no

Reference material

  • "Java Programming"

Guess you like

Origin blog.csdn.net/nemeziz/article/details/84542875