The Java Tutorials have been written for JDK 8.Java教程是为JDK 8编写的。Examples and practices described in this page don't take advantage of improvements introduced in later releases and might use technology no longer available.本页中描述的示例和实践没有利用后续版本中引入的改进,并且可能使用不再可用的技术。See Java Language Changes for a summary of updated language features in Java SE 9 and subsequent releases.有关Java SE 9及其后续版本中更新的语言特性的摘要,请参阅Java语言更改。
See JDK Release Notes for information about new features, enhancements, and removed or deprecated options for all JDK releases.有关所有JDK版本的新功能、增强功能以及已删除或不推荐的选项的信息,请参阅JDK发行说明。
In this lesson you will learn the basics of the JDBC API.在本课中,您将学习JDBCAPI的基础知识。
Getting Started起步 sets up a basic database development environment and shows you how to compile and run the JDBC tutorial samples.设置一个基本的数据库开发环境,并向您展示如何编译和运行JDBC教程示例。
Processing SQL Statements with JDBC用JDBC处理SQL语句 outlines the steps required to process any SQL statement.概述处理任何SQL语句所需的步骤。The pages that follow describe these steps in more detail:以下页面将更详细地描述这些步骤:
Establishing a Connection建立联系 connects you to your database.将您连接到数据库。
Connecting with DataSource Objects连接数据源对象 shows you how to connect to your database with 演示如何使用DataSource
objects, the preferred way of getting a connection to a data source.DataSource
对象连接到数据库,这是获得数据源连接的首选方法。
Handling SQLExceptions处理SQLException shows you how to handle exceptions caused by database errors.演示如何处理由数据库错误引起的异常。
Setting Up Tables设置表 describes all the database tables used in the JDBC tutorial samples and how to create and populate tables with JDBC API and SQL scripts.介绍JDBC教程示例中使用的所有数据库表,以及如何使用JDBCAPI和SQL脚本创建和填充表。
Retrieving and Modifying Values from Result Sets从结果集中检索和修改值 develop the process of configuring your database, sending queries, and retrieving data from your database.开发配置数据库、发送查询和从数据库检索数据的过程。
Using Prepared Statements使用事先准备好的语句 describes a more flexible way to create database queries.描述一种更灵活的创建数据库查询的方法。
Using Transactions使用事务 shows you how to control when a database query is actually executed.演示如何控制实际执行数据库查询的时间。
Using RowSet Objects使用RowSet对象 introduces you to 介绍RowSet
objects; these are objects that hold tabular data in a way that make it more flexible and easier to use than result sets.RowSet
对象;这些对象以比结果集更灵活、更易于使用的方式保存表格数据。The pages that follow describe the different kinds of 以下页面描述了可用的不同类型的RowSet
objects available:RowSet
对象:
Using Advanced Data Types使用高级数据类型 introduces you to other data types; the pages that follow describe these data types in further detail:向您介绍其他数据类型;以下页面将进一步详细描述这些数据类型:
Using Stored Procedures使用存储过程 shows you how to create and use a stored procedure, which is a group of SQL statements that can be called like a Java method with variable input and output parameters.演示如何创建和使用存储过程,存储过程是一组SQL语句,可以像Java方法一样使用可变的输入和输出参数进行调用。
Using JDBC with GUI API使用JDBC配合GUI API demonstrates how to integrate JDBC with the Swing API.演示如何将JDBC与Swing API集成。