JDBC Basics (1) JDBC, Java platform connectivity. In a vernacular, what does it mean? It is the Java platform and database for linking / "tools /". Still first review the interface: from bottom to, The interface is an abstraction of / "case /", from a case abstract rule. In turn, from top, abstract interface is a commitment and constraint for the case. That is, as long as you implement me The specified interface, your class has already had a way to promise the external promise, as long as the client / "will operate the interface, do not need to re-learn, it will operate the new class of the interface! Ok, use it, use: 1. The same behavior of the unrelated class can be achieved by an interface. 2. You can specify how many classes need to be implemented via the interface. 3. You can understand the interaction method of the object without the need to understand the class Blu. This is required. A few words are very clear? It seems to have a book for books to write this passage. As a result, someone else is not as good as I understand, but I understand why some people want to write books. . In understanding this thing, JDBC is well understood. For universal, Java requires a mechanism to operate the same method when operating different manufacturers database, rather than every contact of a database is new. Method. Complete this mechanism / "things /" is called / "jdbc /". Simple points, JDBC has two parts, JDBC API and JDBC Driver Interface. JDBC API is provided to / "Customer /" (ie It is like this kind of rookie-level programmer. If it is a master written JDBC, a group of independent of the database's API, the operation of any database can be done with this set of APIs. So Translate these universal APIs into a specific database can be understood by JDBC Driver Interface, so this part is a programming interface for JDBC driver developers, which will pass us through JDBC API The general instruction sent to the database translated to their own database. Or use the actual operation to see how JDBC work. Because the JDBC API is a general interface, how does the program know which database I want to connect? So When connecting to the database, you should load (or register available driver), actually the JDBC signature. Load the driver and a lot of methods, the most commonly used, first dissolve the driver class into memory, as / "current /" driver. Note / "Current /" is that there are multiple drivers in memory, but only the currently loaded drivers are the first-selection driver. Class.Forname (/ "org.gjt .mm.mysql.driver / "); Class.Forname method is the DRIVER class that is soluble in memory in memory. JDBC API interface. For example, the instance object of Org.gjt.mm.mysql.connection is assigned to the java.sql.connection interface handle, so that the client / "can call the actual ORG by operating the Java.sql.Connection handle. .gjt.mm.mysql.connection method. It is if the mapping is mapped, this is the manufacturer programming, / "customer /" as long as Class.Forname (/ "org.gjt.mm.mysql.driver /" The method can operate smoothly. The JDBC API is operated. The connection process of a normal database is: 1. Load the driver. 2. DraiverManager to get a handle with the database. 3. Bind the statement to be executed by connecting the handle 4. Receive the execution result. 5. Optional to the result of the result. 6. The necessary shutdown and database connection.