Introduction to JDBC Technology in Java

Source: Internet
Author: User

JDBC is a JAVAAPI (applicationprogramminginterface application design interface) that can be used to execute SQL statements. It consists of classes and interfaces written in some Java languages. JDBC provides a standard application design interface for database application developers, database foreground tool developers, and enables developers to write complete database applications in the Pure Java language.

First, the development of ODBC to JDBC process

When it comes to JDBC, it's easy to think of another familiar word, "ODBC." Are there any connections between them? If so, what is the relationship between them?

ODBC is a opendatabaseconnectivity English shorthand. It is a standard application data interface used in C language to access data in related or unrelated database management systems (DBMS). With ODBCAPI, applications can access data stored in a variety of different database management systems (DBMS), regardless of the data storage format and programming interfaces used by each DBMS.

Structure model of 1.ODBC

The structure of ODBC consists of four main parts: The application interface, the drive manager, the database drive, and the data source.

Application interface: Masks differences in function calls between different ODBC database drives, providing users with a unified SQL programming interface.

Drive Manager: Mounts the database drive for the application.

Database drive: A function call that implements ODBC to provide SQL requests to a specific data source. If necessary, the database drive modifies the application's request, allowing the request to conform to the grammar supported by the associated DBMS.

Data source: The data that the user wants to access and the operating system and DBMS associated with it, and the network platform used to access the DBMS.

Although the primary purpose of the ODBC drive Manager is to load the database drive for ODBC function calls, the database drive itself performs an ODBC function call and is compatible with the database. Therefore, when an application makes a call to connect to the data source, the database drive manages the communication protocol. When a connection to a data source is established, the database drive can process requests from the application system to the DBMS, translate the necessary translations into the analysis or design from the data source, and return the results to the application system.

The birth of the 2.JDBC

Java has been popular all over the world since the Java language was officially published in May 1995. There are a number of programs written in the Java language, including database applications. Because there is no Java language API, programmers have to add a C-language ODBC function call to the Java program. This makes a lot of Java's outstanding features can not be fully played, such as platform independence, object-oriented characteristics. As more and more programmers become more and more interested in the Java language, more and more companies are devoting more and more effort to Java program development, and the API of accessing database of Java language interface is becoming more and more strong. And because ODBC has its drawbacks, such as its not easy to use, no object-oriented features, and so on, Sun decides to develop a database application development interface for the Java language interface. In the jdk1.x version, JDBC is only an optional part, and when the JDK1.1 is published, the SQL class package (that is, JDBCAPI) becomes the standard part of the Java language.

Ii. Overview of JDBC Technology

JDBC is a javaapi (applicationprogramminginterface, application design interface) that can be used to execute SQL statements. It consists of classes and interfaces written in some Java languages. JDBC provides a standard application design interface for database application developers, database foreground tool developers, and enables developers to write complete database applications in a pure Java language.

By using JDBC, developers can easily deliver SQL statements to almost any database. That is, developers can not write a program to access Sybase, write another program to access Oracle, and then write a program to access Microsoft SQL Server. A program written with JDBC can automatically transmit SQL statements to the appropriate database management system (DBMS). Furthermore, applications written in Java can be run on any Java-enabled platform without the need to write different applications on different platforms. The combination of Java and JDBC allows developers to actually implement "writeonce,runeverywhere!" when developing database applications

Java, with its robustness, security, ease of use, and support for automated online downloads, is essentially a good programming language for database applications. What it needs is how Java applications connect to a wide variety of databases, and JDBC is the key to achieving this connection.

JDBC extends Java capabilities, such as using Java and JDBCAPI to advertise a Web page with Ap?plet with access to remote databases. Or the enterprise can use JDBC to enable all employees (who can work with different operating systems, such as Windwos,machintosh and Unix) to connect to several global databases on in?tranet, and these global databases can vary. As more and more program developers use the Java language, the need for Java access to databases is increasingly strong.

MIS administrators like Java and JDBC because it makes it easier to advertise information more economically. All the transactions that have been installed in the database will continue to function, even if the transactions are stored in different database management systems, and for new database applications, the development time will be shortened, and installation and version upgrades will be greatly simplified. Programmers can write or rewrite a program, and then put it on the server, and each user can access the server to get the latest version. For the information service industry, Java and JDBC provide a good way to update information to outside users.

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.