Study number 20145336 "Java Program Design" 9th Week study summary Textbook Learning content Summary JDBC
JDBC is a solution for executing SQL, the developer uses the standard interface of JDBC, the database vendor operates on the interface, and the developer does not have to touch the differences of the underlying database driver.
JDBC is the standard specification for Java online databases. Specifically, it defines a set of standard classes and interfaces that the application requires when the online database is called, while the interfaces in the standard API are operated by the database vendor, often referred to as the JDBC driver.
JDBC (Java database Connectivity) is the standard specification for Java online databases.
Four types of drives
-
JDBC-ODBC Bridge Driver: The driver translates the JDBC call into a call to the ODBC driver, which operates the database by the ODBC driver.
-
Native API Driver: The driver will call the native link library provided by the database in its native way.
-
Jdbc-net Driver: The driver translates the JDBC method call into a specific network protocol call.
-
Native protocal Driver: The driver translates the JDBC call into a database-specific network protocol to communicate with the database.
Each type will have a corresponding type:
- Package corresponding type is Java.lang.Package
- The constructor corresponds to a type of java.lang.reflect.Constructor
- Method member corresponding type is Java.lang.reflect.Method
- data member corresponding type is Java.lang.reflect.Field
To connect to the database, you must have a vendor-operated JDBC driver, and you must set the driver jar document in Classpath to get the database online, there are several actions that must be
- Registering the Driver Action object
- Get Connection Action Object
- Close the Connection action object
Statement, Resultset:conection is the database connection representative object, next must obtain the Java.sql.Statement action object calls clearstatement clears the set parameters, You can then use this PreparedStatement instance again
Use DataSource to get online: Messagedao relies on the Javax.sql.DataSource interface, which can be obtained by means of a defined getconnection () method connection
Use resultset to scroll, update data: ResultSet can not only use previous () first (), last () and other methods to move data before and after, you can also call Updatexxx (), UpdateRow ()
Problems in code debugging and the resolution process
This is this week's code hosting:
Other (sentiment, thinking, etc, optional) Learning progress bar
|
lines of code (new | /Cumulative)
Blog volume ( | new/cumulative)
Learning time (new/cumulative) |
Important growth |
| Goal |
5000 rows |
30 Articles |
400 hours |
|
| First week |
150/150 |
1/1 |
15/15 |
|
| Second week |
150/400 |
1/2 |
15/30 |
|
| Third week |
150/550 |
1/3 |
20/50 |
|
| Week Four |
150/700 |
1/4 |
16/56 |
|
| Week Five |
150/850 |
1/5 |
19/65 |
| Week Six |
150/1000 |
2/7 |
23/88 |
| Seventh Week |
150/1150 |
2/9 |
22/110 |
| Eighth Week |
150/1300 |
2/11 |
29/139 |
| Nineth Week |
200/1500 |
2/13 |
26/155 |
Resources
- Java Learning Notes (8th Edition)
- Java Learning Note (8th Edition) Learning Guide
- ...
Java Nineth Week Study summary