javax.sql.RowSet group of interfaces, can be customized to use and update data from a spread sheet, flat file, or any other tabular data source.
java.sql package, referred to as the JDBC core API, and the
javax.sql package, referred to as the JDBC Optional Package API. This complete JDBC API is included in the Java
TM Standard Edition (Java SE
TM), version 7. The
javax.sql package extends the functionality of the JDBC API from a client-side API to a server-side API, and it is an essential part of the Java
TM Enterprise Edition (Java EE
TM) technology.
类,接口,方法,字段,构造函数和异常具有以下“since”标记,用于指示它们何时引入到Java平台中。 当这些“since”标签用于JDBC API的Javadoc TM注释中时,它们表示如下:
注意:许多新功能都是可选的; 因此,司机和他们支持的功能有一些变化。 在尝试使用它之前,请务必检查您的驱动程序的文档以查看它是否支持某项功能。
注意:类SQLPermission已添加到Java TM 2 SDK标准版1.3版中。 该类用于防止未经授权访问与DriverManager关联的日志流,该日志流可能包含诸如表名,列数据等信息。
java.sql Package Containsjava.sql package contains API for the following:
DriverManager facility
DriverManager class -- makes a connection with a driver SQLPermission class -- provides permission when code running within a Security Manager, such as an applet, attempts to set up a logging stream through the DriverManager Driver interface -- provides the API for registering and connecting drivers based on JDBC technology ("JDBC drivers"); generally used only by the DriverManager class DriverPropertyInfo class -- provides properties for a JDBC driver; not used by the general user Statement -- used to send basic SQL statements PreparedStatement -- used to send prepared statements or basic SQL statements (derived from Statement) CallableStatement -- used to call database stored procedures (derived from PreparedStatement) Connection interface -- provides methods for creating statements and managing connections and their properties Savepoint -- provides savepoints in a transaction ResultSet interface Array interface -- mapping for SQL ARRAY Blob interface -- mapping for SQL BLOB Clob interface -- mapping for SQL CLOB Date class -- mapping for SQL DATE NClob interface -- mapping for SQL NCLOB Ref interface -- mapping for SQL REF RowId interface -- mapping for SQL ROWID Struct interface -- mapping for SQL STRUCT SQLXML interface -- mapping for SQL XML Time class -- mapping for SQL TIME Timestamp class -- mapping for SQL TIMESTAMP Types class -- provides constants for SQL types SQLData interface -- specifies the mapping of a UDT to an instance of this class SQLInput interface -- provides methods for reading UDT attributes from a stream SQLOutput interface -- provides methods for writing UDT attributes back to a stream DatabaseMetaData interface -- provides information about the database ResultSetMetaData interface -- provides information about the columns of a ResultSet object ParameterMetaData interface -- provides information about the parameters to PreparedStatement commands SQLException -- thrown by most methods when there is a problem accessing data and by some methods for other reasons SQLWarning -- thrown to indicate a warning DataTruncation -- thrown to indicate that data may have been truncated BatchUpdateException -- thrown to indicate that not all commands in a batch update executed successfully java.sql and javax.sql Features Introduced in the JDBC 4.1 APIConnection, ResultSet and Statement objects to be used with the try-with-resources statementCallableStatement and ResultSet to specify the Java type to convert to via the getObject methodDatabaseMetaData methods to return PseudoColumns and if a generated key is always returnedConnection to specify a database schema, abort and timeout a physical connection.Statement object when its dependent objects have been closedDriver, DataSource, ConnectionPoolDataSource and XADataSourcejava.sql and javax.sql Features Introduced in the JDBC 4.0 APIjava.sql.Driver class via Class.forName PreparedStatement that is associated with a PooledConnection has been closed or the driver determines is invalid java.sql and javax.sql Features Introduced in the JDBC 3.0 APIConnectionPoolDataSource -- specify how connections are to be pooled PreparedStatement object ResultSet objects returned from CallableStatement objects open at the same time CallableStatement objects by name as well as by index ResultSet holdability -- ability to specify whether cursors should be held open or closed at the end of a transaction Ref object references BLOB, CLOB, ARRAY, and REF values. java.sql.Types.DATALINK data type -- allows JDBC drivers access to objects stored outside a data source java.sql Features Introduced in the JDBC 2.1 Core APIResultSet interface that allow the cursor to be moved to a particular row or to a position relative to its current position ResultSet updater methods java.math.BigDecimal values, additional security, and support for time zones in date, time, and timestamp values. javax.sql Features Introduced in the JDBC 2.0 Optional Package APIDataSource interface as a means of making a connection. The Java Naming and Directory InterfaceTM (JNDI) is used for registering a DataSource object with a naming service and also for retrieving it. RowSet technology -- providing a convenient means of handling and passing data DISTINCT type are the UDTs that may be custom mapped. The following three steps set up a custom mapping:
DISTINCT type in SQL SQLData interface. Connection object's type map that contains two things:
Class object for the class that implements the SQLData interface 对UDT执行这些操作时,在该UDT上调用方法ResultSet.getObject或CallableStatement.getObject将自动为其检索自定义映射。 另外, PreparedStatement.setObject方法将自动将对象映射回其SQL类型以将其存储在数据源中。
| Array | Java编程语言中用于SQL类型 ARRAY 。 |
| Blob | SQL BLOB值在Java TM编程语言中的表示形式(映射)。 |
| CallableStatement | 用于执行SQL存储过程的接口。 |
| Clob | Java TM编程语言中用于SQL CLOB类型的映射。 |
| Connection | 与特定数据库的连接(会话)。 |
| DatabaseMetaData | 有关整个数据库的全面信息。 |
| Driver | 每个驱动程序类必须实现的接口。 |
| NClob | Java TM编程语言中用于SQL NCLOB类型的映射。 |
| ParameterMetaData | 一个对象,可用于获取有关 PreparedStatement对象中每个参数标记的类型和属性的信息。 |
| PreparedStatement | 表示预编译的SQL语句的对象。 |
| Ref | 在SQL编程语言中映射SQL REF值,该值是对数据库中SQL结构化类型值的引用。 |
| ResultSet | 表示数据库结果集的数据表,通常通过执行查询数据库的语句生成。 |
| ResultSetMetaData | 一个对象,可用于获取有关 ResultSet对象中列的类型和属性的信息。 |
| RowId | SQL ROWID值在Java编程语言中的表示(映射)。 |
| Savepoint | 保存点的表示,它是当前事务中的一个点,可以从 Connection.rollback方法中引用。 |
| SQLData | 用于将Java用户定义类型(UDT)自定义映射到Java编程语言中的类的接口。 |
| SQLInput | 包含表示SQL结构化类型或SQL不同类型的实例的值流的输入流。 |
| SQLOutput | 用于将用户定义类型的属性写回数据库的输出流。 |
| SQLXML | JavaTM编程语言中针对SQL XML类型的映射。 |
| Statement | 用于执行静态SQL语句并返回其生成的结果的对象。 |
| Struct | 用于SQL结构化类型的Java编程语言中的标准映射。 |
| Wrapper | JDBC类的接口,当有问题的实例实际上是一个代理类时,它提供了检索委托实例的能力。 |
| Date | 一个包含毫秒值的精简包装器,它允许JDBC将其标识为SQL |
| DriverManager | 管理一组JDBC驱动程序的基本服务。 |
| DriverPropertyInfo | 用于建立连接的驱动程序属性。 |
| SQLPermission | 旧版安全代码; 不使用。 |
| Time | 围绕 |
| Timestamp | 一个围绕 |
| Types | 定义用于标识通用SQL类型的常量的类,称为JDBC类型。 |
| ClientInfoStatus | 列举了不能通过调用 Connection.setClientInfo来设置属性的原因的状态 |
| RowIdLifetime | 枚举RowId生命周期值。 |
| BatchUpdateException | 在批量更新操作期间发生错误时引发的子类 SQLException 。 |
| DataTruncation | DataTruncation异常(写入时)引发的异常或 DataTruncation警告(读取时)引发的异常,因为数据值由于除MaxFieldSize MaxFieldSize原因而意外截断。 |
| SQLClientInfoException | 的子类 SQLException当一个或多个客户端信息属性不能在设置抛出 Connection 。 |
| SQLDataException | 在SQLState类的值为' 22 '时或在供应商指定的条件下引发的 SQLException的子类。 |
| SQLException | 提供有关数据库访问错误或其他错误信息的例外。 |
| SQLFeatureNotSupportedException | SQLState类的值为' 0A '(值为'零'A)时引发的子类 SQLException 。 |
| SQLIntegrityConstraintViolationException | SQLState类的值为' 23 '时或在供应商指定的条件下引发的子类 SQLException 。 |
| SQLInvalidAuthorizationSpecException | SQLState类值为' 28 '时或在供应商指定的条件下引发的 SQLException的子类。 |
| SQLNonTransientConnectionException | SQLException的子类为SQLState类值“ 08 ”或在供应商指定的条件下抛出。 |
| SQLNonTransientException | SQLException的子类当同一操作的重试失败除非 SQLException的原因得到纠正的情况下抛出。 |
| SQLRecoverableException | 如果应用程序执行一些恢复步骤 SQLException试整个事务,或者在分布式事务(事务分支)的情况下,先前失败的操作可能成功的情况下引发的子类 SQLException 。 |
| SQLSyntaxErrorException | SQLState类的值为' 42 '时或在供应商指定的条件下引发的子类 SQLException 。 |
| SQLTimeoutException | 当由 |
| SQLTransactionRollbackException | SQLState类值为' 40 '时或在供应商指定的条件下引发的子类 SQLException 。 |
| SQLTransientConnectionException | SQLState类值为' 08 '的 SQLException的子类或供应商指定的条件下。 |
| SQLTransientException | SQLException的子类在先前失败的操作可能能够成功执行的情况下抛出,如果重试操作而没有任何应用程序级功能的干预。 |
| SQLWarning | 提供有关数据库访问警告信息的例外。 |