2017.10.1 JDBC Database access Technology

Source: Internet
Author: User

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

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.