20145216 Shi Yao "java program Design" 9th Week Study Summary

Source: Internet
Author: User
Tags time and date

20145216 Java Programming 9th Week Study Summary Textbook Study summary 16th Chapter Integration Database 16.1 JDBC Getting Started
  • The composing application uses the communication protocol to carry on the instruction exchange to the database, in order to carry on the data deletion search.

  • JDBC Purpose: To allow Java program designers to compose a database operation program can have a unified interface, no need to rely on a specific database API, "Write a Java program, operate all databases."

  • Online database, you need to set the JDBC driver in classpath.

  • Basic database operations are related to JDBC interfaces or classes that are located in the java.sql package.

  • The action object of the connection interface is the database online representative object.

  • Statement is a representative object of SQL description and can be executed using methods such as executeupdate (), ExecuteQuery (), and so on.

  • The statement executeupdate () method is used for SQL that queries the database, such as SELECT, and returns an int result that represents the number of changes in the data.

  • The statement executequery () method returns the Java.sql.ResultSet object, which represents the query result.

  • The Execute () method of the statement is used to execute SQL, which returns true to indicate that SQL execution will return.

  • If some of the operations are just some of the parameters in the SQL statement, and the rest of the SQL clauses are the same, you can use Java.sql.PreparedStatement. Call Clearparametere () to clear the parameters of the setting, and then use the PreparedStatement instance again.

  • If you compose a stored procedure for a database and want to invoke it using JDBC, you can use Java.sql.CallableStatement. You must call Preparecall () to establish the CallableStatement exception, and you can register the output parameters with Registeroutparameter ().

16.2 JDBC Advanced
  • Let Messagedao rely on the Java.sql.DataSource interface, which can be connection by its defined getconnection () method.

  • In the future to modify the database server host location, in order to reuse the connection object and want to join the online pool mechanism, and so on, this messagedao without modification.

  • Online related information can be set using the. Properties.

  • When you create an statement or PreparedStatement instance, you can specify the result set type and parallel mode.

  • The limit for batch updates is that SQL cannot make a select, otherwise it throws an exception.

  • To support batch updates, you must append the Rewritebatchedstatements = True parameter to the JDBC URL to have a practical effect.

  • BLOBs are used to store large amounts of binary data, such as image files, audio files, etc., and CLOB are used to store large amounts of literal data.

  • The Blob field can be byte[] or input \ output stream.

  • In transaction management, you can set a storage point only if you want to recall a SQL execution point.

  • Through JDBC to know whether the database supports an isolation behavior setting, you can obtain the DatabaseMetaData object through connection's GetMetaData (). The DatabaseMetaData supporttransaction-isolationlevel () is known to support an isolated behavior.

  • Metadata is "the data of reading data" can be obtained through the connection GetMetaData () method DatabaseMetaData object, can obtain the overall information of the database, and resultset represents the query to the data, The ResultSetMetaData object can be obtained by ResultSet's GetMetaData () method.

  • A Javax.sql.RowSet interface that represents a collection of columns of data. The collection of columns can be added and checked. The query instruction is set by SetCommand (), and execute () executes the query instruction to populate the data.

Other (sentiment, thinking, etc., optional)this week's study content has three chapters, the task is heavier, but fortunately only one chapter, so I spend most of the time to study the 16th chapter above, the time quickly, originally felt the thick of the "Java study notes" so learned, but these weekly self-study and then write study blog days past, How much knowledge have I really mastered? Have to say, for the first few chapters of the knowledge point, I still have some certainty, but the more to the back of the chapter, the content more and more difficult to understand, really learn less knowledge, but I think learning Java This course the biggest harvest or let me learn how to self-study. Code Hosting

Learning progress Bar /Cumulative) new/cumulative)
lines of code (newBlog volume (Learning time (new/cumulative) Important growth
Goal 4500 rows 30 Articles 350 hours Be able to use Java freely
First week 150/150 2/2 15/15 Learn basic Java-related knowledge
Second week 200/350 1/3 20/35

Learn the basic syntax of Java

Third week 450/800 1/4 25/60

Learn about object and package knowledge

Week Four 687/1487 1/5 30/90

Learn about inheritance and interface knowledge

Week Five 803/2290 1/6 30/120

Learn about exception handling and collection and map knowledge

Week Six 910/3200 2/8 40/160

Learn about input, output, and threading

Seventh Week 350/3550 2/10 30/190

Learn the time and date related knowledge

Eighth Week 350/3900 2/12 30/220

Learn about the Common API

Nineth Week 400/4300 2/14 30/250

Learn about the integrated database

Resources
    • Java Learning Notes (8th Edition)
    • Java Learning Note (8th Edition) Learning Guide

20145216 Shi Yao "java program Design" 9th Week 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.