官术网_书友最值得收藏!

Chapter 1. JDBC 4.0

The Java Database Connectivity API is used to access a SQL database from a Java application. JDBC also supports tabular data sources, such as a spreadsheet. We will constrain our discussion to SQL relational databases. Using JDBC API, SQL statements can be run in a database. JDBC started as JDBC 1.0 API; JDBC 1.0 covered the basics of establishing a connection with a database, running SQL statements, retrieving values from result sets, and using transactions. JDBC 2.0 introduced scrollable result sets, JDBC methods to update a result set or a database table, batch updates, and SQL3 data types such as, BLOB, CLOB, Array, Ref, and Struct. JDBC 3.0 introduced savepoints, connection pooling of prepared statements, multiple open ResultSet objects, BOOLEAN data type, and an interface for parameter metadata and for retrieving database metadata. JDBC 4.0 specifications added some new features, which we will discuss in this chapter.

The JDBC API provides various interfaces and classes for accessing a database; creating tables in the database; and adding, updating, deleting data, in the database tables. In the following sections, we will discuss some of the JDBC classes and interfaces. We will also discuss the new methods added to these classes or interfaces, in JDBC 4.0 specifications. To run a JDBC 4.0 application, install a RDBMS database such as the open-source MySQL database or the commercial Oracle database. A JDBC driver class is required to establish a connection with the database. JDBC drivers are vendor-specific. A JDBC driver class implements the java.sql.Driver interface.

主站蜘蛛池模板: 元氏县| 淮阳县| 青河县| 巩义市| 阿城市| 合水县| 芦山县| 巨野县| 长治县| 蓬安县| 罗城| 贺兰县| 三门峡市| 霍山县| 保定市| 上饶市| 武穴市| 本溪| 乌拉特后旗| 同仁县| 六安市| 洱源县| 乌兰浩特市| 寿宁县| 阿克苏市| 轮台县| 海林市| 饶河县| 九江市| 姜堰市| 兰西县| 万宁市| 忻城县| 平乐县| 昭平县| 监利县| 景德镇市| 青浦区| 西乌珠穆沁旗| 临漳县| 富蕴县|