4.1 JDBC Technology brief4.1.1 definitionJDBC (Java Data Base Connectivity,java database connection) is a method for executing SQL statements.The Java API, which consists of a set of classes and interfaces, can be used to invoke the methods provided by these classes and interfaces, using the standardSQL language to access data from the database.
(1) database driver:
An interface between an application and a database product is implemented to submit SQL requests to the database;
(2) Driver Manager (Drivermanaager):
To load a database driver for an application
(3) JDBC API:
Provides a series of abstract interfaces, mainly used to connect the database and directly invoke SQL commands, execute various SQL statements;
4.1.2 JDBC Important classes and interfaces
Class or interface function
Java.sql.DriverManager This class handles the loading of the driver and establishes a new database connection
Java.sql.Connection this interface to implement a connection to a specific database
Java.sql.Satement This interface represents the object used to execute a static SQL statement and return the results it produces
Java.sql.PreparedSatement an object that represents a precompiled SQL statement, derives from satement, compiles SQL efficiently and supports parameter queries
Java.sql.CallableSatement This interface represents the object used to execute the SQL statement stored procedure. Derived from Preparedsatement, which is used to invoke stored procedures in the database.
Java.sql.ResultSet This interface represents the database of the database result set, which is commonly known by executing the query database statement generation
Driver Interface Driver
Each database provides a database driver and provides a class that implements the Java.sql.Driver interface, referred to as the driver class
During the re-application development process, the driver class needs to be loaded through the static method forname (String className) of the Java.land.Class class, creating its own case at load time and Java.sql.DriverManager
2017.10.1 JDBC Database access technology