java.sql
Interface Array
实现该接口的类:SerialArray
在java编程语言对于SQL类型ARRAY的映射。默认情况下,一个Array值是对一个SQL ARRAY的值持久事务引用。默认情况下,Array对象是使用SQL LOCATOR(array)内部实现的,这意味着一个Array对象包含一个逻辑指向SQL ARRAY 数组中数据的指针,而不是包含ARRAY值的数据。
Array接口提供方法把SQL ARRAY值的数据以数组或ResultSet对象的形式传到
客户端。如果SQL ARRAY的元素是UDT (用户自定义类型) 的,则可以自定义映射。要创建一个自定义映射,一个程序员必须做两件事:
- 新建一个类实现SQLData接口以使UDT可以自定义映射
- 创建一个类型映射的条目包括:
- 完全有效的UDT的SQL类型名
- 实现了SQLData接口的类的对象
JDBC驱动支持的数据类型必须实现Array接口的所有方法。
-
-
Since:
1.2
-
-
Method Summary
Modifier and Type Method and Description void
free()
This method frees theArray
object and releases the resources that it holds.Object
getArray()
Retrieves the contents of the SQLARRAY
value designated by thisArray
object in the form of an array in the Java programming language.Object
getArray(long index, int count)
Retrieves a slice of the SQLARRAY
value designated by thisArray
object, beginning with the specifiedindex
and containing up tocount
successive elements of the SQL array.Object
getArray(long index, int count, Map<String,Class<?>> map)
Retreives a slice of the SQLARRAY
value designated by thisArray
object, beginning with the specifiedindex
and containing up tocount
successive elements of the SQL array.Object
getArray(Map<String,Class<?>> map)
Retrieves the contents of the SQLARRAY
value designated by thisArray
object.int
getBaseType()
Retrieves the JDBC type of the elements in the array designated by thisArray
object.String
getBaseTypeName()
Retrieves the SQL type name of the elements in the array designated by thisArray
object.ResultSet
getResultSet()
Retrieves a result set that contains the elements of the SQLARRAY
value designated by thisArray
object.ResultSet
getResultSet(long index, int count)
Retrieves a result set holding the elements of the subarray that starts at indexindex
and contains up tocount
successive elements.ResultSet
getResultSet(long index, int count, Map<String,Class<?>> map)
Retrieves a result set holding the elements of the subarray that starts at indexindex
and contains up tocount
successive elements.ResultSet
getResultSet(Map<String,Class<?>> map)
Retrieves a result set that contains the elements of the SQLARRAY
value designated by thisArray
object.
-